<?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=Adsimps3</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=Adsimps3"/>
	<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=Special:Contributions/Adsimps3"/>
	<updated>2026-05-11T10:58:46Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.41.0</generator>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2018-_Project_M1803:_Implement_a_web_page_fuzzer_to_find_rendering_mismatches_(Part_2)&amp;diff=117448</id>
		<title>CSC/ECE 517 Spring 2018- Project M1803: Implement a web page fuzzer to find rendering mismatches (Part 2)</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2018-_Project_M1803:_Implement_a_web_page_fuzzer_to_find_rendering_mismatches_(Part_2)&amp;diff=117448"/>
		<updated>2018-05-04T16:57:23Z</updated>

		<summary type="html">&lt;p&gt;Adsimps3: /* Introduction */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;By Alexander Simpson(adsimps3), Abhay Soni (asoni3), Dileep badveli (dbadvel) and Jake Batty(jbatty)&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
This Mozilla project was broken in to 2 main parts: the previous work and the work to be done.  The previous work was finished as a part of the OSS project.  As a part of the OSS project (explained more below) we created a tool which generates random valid HTML files and automated servo.  [https://en.wikipedia.org/wiki/Servo_(layout_engine) Servo] is experimental web browser developed by Mozilla to &amp;quot;to create a new layout engine using a modern programming language&amp;quot;.  By automating servo (the web browser) we were able to quickly see if servo could render the randomly generated pages.  &lt;br /&gt;
&lt;br /&gt;
The goal of this final project was to build off the original project while adding more features.  The work we completed as a part of this project is split into a couple main parts.  First, we extended the program created in the OSS project to also control Firefox.  By also controlling Firefox, we then had 2 screenshots of the randomly generated content - Servo and Firefox .  After getting both screenshots, we then compared them using Python and OpenCV.  Finally, we were able to expand upon the page generation tool to allow the randomly generated web pages to have more properties/be more complex.&lt;br /&gt;
&lt;br /&gt;
A demo video of our project can be found in 2 parts: [https://www.youtube.com/watch?v=7GP4v54rbQM&amp;amp;feature=youtu.be Part1] and [https://www.youtube.com/watch?v=PDo1G-e1ziE&amp;amp;feature=youtu.be Part2]&lt;br /&gt;
&lt;br /&gt;
==Previous Work (Part of the OSS Project)==&lt;br /&gt;
&lt;br /&gt;
As per the [https://github.com/servo/servo/wiki/Random-web-content-project project description], we were expected to complete the initial steps. The implementation is explained below for each of these steps.&lt;br /&gt;
&lt;br /&gt;
:1) In a new repository, create a program that can generate a skeleton HTML file with a doctype, head element, and body element, print the result to stdout&lt;br /&gt;
::- Here is the [https://github.com/asoni3/Random-web-content-generator---CSC-517-OSS-Project link] to the repository which contains code_generation.py file which will be used to generate random valid HTML files.&lt;br /&gt;
:2) Add a module to the program that enable generating random content specific to the &amp;lt;head&amp;gt; element (such as inline CSS content inside of a &amp;lt;style&amp;gt; element) and add it to the generated output&lt;br /&gt;
::- The file [https://github.com/asoni3/Random-web-content-generator---CSC-517-OSS-Project/blob/master/code_generation.py code_generation.py], contains the code which generates random content specific to the head element and adds style on top of it. As seen in this code, after generating random content to the file, we will add CSS elements on top of this content. We have established a list of commonly used styles, weights, fonts, font_styles, and alignments which will be used at random. For practical purposes, we are limiting the number of options.&lt;br /&gt;
:3) Add a module to the program that enables generating random content specific to the &amp;lt;body&amp;gt; element (such as a &amp;lt;p&amp;gt; block that contains randomly generated text) and add it to the generated output&lt;br /&gt;
:4) Generate simple random CSS that affects randomly generated content (ie. if there is an element with an id foo, generate a CSS selector like #foo that applies a style like colorto it)&lt;br /&gt;
:5) Create a program under Servo's etc/ that launches Servo and causes it to [https://github.com/servo/servo/wiki/Control-Servo-using-WebDriver take a screenshot] of a particular URL - use this to take screenshots of pages randomly generated by the previous program&lt;br /&gt;
:Sample Screenshot:&lt;br /&gt;
:[[File:Servoscreenshot.png|border]]&lt;br /&gt;
&lt;br /&gt;
==Lists of Tasks==&lt;br /&gt;
Below is a list of the tasks that were completed as a part of our final project.  Below each task we have described how exactly it was implemented with code examples.   &lt;br /&gt;
 &lt;br /&gt;
:'''1) Extend the program that controls Servo to also control Firefox using geckodriver'''&lt;br /&gt;
Task 1 is relatively simple.  It just involves downloading geckodriver and running it.  Geckodriver is an open source software engine that allows us to render marked content on a web browser.  It should allow us to take screenshots of a particular URL, just like task 5 in the previous work section, but for Firefox instead.  &lt;br /&gt;
&lt;br /&gt;
:'''2) Compare the resulting screenshots and report the contents of the generated page if the screenshots differ'''&lt;br /&gt;
This task involves automating Firefox to use geckodriver and the current servo program.  They both will create 2 different screenshots.  If servo and Firefox render it differently, we will report that file and mark the differences.  &lt;br /&gt;
&lt;br /&gt;
:'''3) Extend the page generation tool with a bunch of additional strategies, such as:'''&lt;br /&gt;
:-Generating elements trees of arbitrary depth&lt;br /&gt;
:-Generating sibling elements&lt;br /&gt;
:-Extending the set of CSS properties that can be generated (display, background, float, padding, margin, border, etc.)&lt;br /&gt;
:-Extending the set of elements that can be generated (span, div, header elements, table (and associated table contents), etc.)&lt;br /&gt;
:-Randomly choose whether to generate a document in quirks mode or not&lt;br /&gt;
&lt;br /&gt;
:'''UML Diagram of Tasks:'''&lt;br /&gt;
Below is a UML diagram of the tasks of the overall system.  As you can see, it covers all 3 tasks.  It starts with the code generation and then it splits and takes screenshots on both Firefox and Servo.  It then compares then screenshots and reports the distance.&lt;br /&gt;
:[[File:UMLDiag.jpg|border|]]&lt;br /&gt;
&lt;br /&gt;
==Implementation of Tasks==&lt;br /&gt;
====1) Extend the program that controls Servo to also control Firefox using geckodriver====&lt;br /&gt;
:To open up Firefox we would use geckodriver and selenium.After browser is opened,html files will be loaded one at a time. A screenshot would be taken of each html file and stored locally as a png file. The resolution of the file is the width and height variables which gets initialized by the arguments, as well as the num_of_files variable is how many different html pages of screenshots would be needed.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 browser = webdriver.Firefox() #opens up the firefox browser&lt;br /&gt;
 for x in range(num_of_files):&lt;br /&gt;
        file = os.path.abspath(&amp;quot;file&amp;quot; + str(x) + &amp;quot;.html&amp;quot;)&lt;br /&gt;
        browser.get(&amp;quot;file:///&amp;quot; + file)  # go to html page with firefox&lt;br /&gt;
        set_viewport(browser, width, height,x)&lt;br /&gt;
        browser.save_screenshot(&amp;quot;screen&amp;quot; + str(x) + &amp;quot;.png&amp;quot;)  # saves the current screen&lt;br /&gt;
 browser.close()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====2) Compare the resulting screenshots and report the contents of the generated page if the screenshots differ====&lt;br /&gt;
:To actually make the comparisons we use [https://opencv.org/ OpenCV].  OpenCV allows us to not only make comparisons but will also mark where the differences in.  To actually do the comparisons we will first read in the images, convert the images to grayscale, and then call compare_ssim().  &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
imageA = cv2.imread(image1)&lt;br /&gt;
imageB = cv2.imread(image2)&lt;br /&gt;
grayA = cv2.cvtColor(imageA, cv2.COLOR_BGR2GRAY)&lt;br /&gt;
grayB = cv2.cvtColor(imageB, cv2.COLOR_BGR2GRAY)&lt;br /&gt;
(score, diff) = compare_ssim(grayA, grayB, full=True)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This gets us a ''score'' and diff ''values''.  The ''score'' variables represents how close the to images are to each other and the ''diff'' variables tells us where the differences are.  If the ''score'' indicates that the images are different we then use the ''diff'' value to findContours() and then draw a rectangle around the differences.  &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
thresh = cv2.threshold(diff, 0, 255, cv2.THRESH_BINARY_INV | cv2.THRESH_OTSU)[1]&lt;br /&gt;
contours = cv2.findContours(thresh.copy(), cv2.RETR_EXTERNAL, cv2.CHAIN_APPROX_SIMPLE)&lt;br /&gt;
contours = contours[0] if imutils.is_cv2() else contours[1]&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After getting contours, we get a rectangle for each contour by calling &amp;quot;(x, y, w, h) = cv2.boundingRect(c)&amp;quot;.  We then combine any rectangles that are inside each other or very close to each other.  After combining the rectangles, we then add the rectangles to each image.  Lastly we then save image A (with the rectangles to show the differences)&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
for rrr in rectangles:&lt;br /&gt;
    x = rrr[0]&lt;br /&gt;
    y = rrr[1]&lt;br /&gt;
    w = rrr[2]&lt;br /&gt;
    h = rrr[3]             &lt;br /&gt;
    cv2.rectangle(imageA, (x, y), (x + w, y + h), (0, 0, 255), 2)&lt;br /&gt;
    cv2.rectangle(imageB, (x, y), (x + w, y + h), (0, 0, 255), 2)&lt;br /&gt;
cv2.imwrite(filename,imageA)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====3) Extend the page generation tool with a bunch of additional strategies, such as:====&lt;br /&gt;
:For task 3 there are several different parts, but the main goal was to increase the complexity of our randomly generated pages. The code_generation.py file was adapted to provide these functions.  The implementation of each subtask is explained below.  &lt;br /&gt;
&lt;br /&gt;
'''Generating elements trees of arbitrary depth and Generating sibling elements&lt;br /&gt;
:We understood a tree of elements to mean divs inside of each other.  By using this definition, it was quite simple to create a tree of elements.  When RandomDiv is called we don't just return a div with a random section.  We also recursively call RandomDiv a random amount of times.  We also may call RandomDiv several time on the same level of the tree.  This effectively creates sibling elements.  Below is the code for RandomDiv.   &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
numDivs = random.randint(1,num_sibling_divs)&lt;br /&gt;
for i in range(0, numDivs):&lt;br /&gt;
    yield '&amp;lt;div id=&amp;quot;a'+str(random.randrange(0,count[0]))+'&amp;quot;&amp;gt;\r\n'&lt;br /&gt;
    yield RandomSection(count, max_depth, num_sibling_divs, tree_height, max_headers, min_headers)&lt;br /&gt;
    if tree_height &amp;gt; 0:&lt;br /&gt;
        treeHeight = random.randint(0, tree_height)&lt;br /&gt;
        if treeHeight &amp;gt; 0:&lt;br /&gt;
            yield RandomDiv(treeHeight - 1, count, max_depth, num_sibling_divs, max_headers, min_headers)          &lt;br /&gt;
    yield '&amp;lt;/div&amp;gt;'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Extending the set of CSS properties that can be generated (display, background, float, padding, margin, border, etc.)&lt;br /&gt;
:Implementing this was relatively simple.  We just did the same thing we did before but with more CSS properties.  Below is the code we used to do this.  It does not include creating the arrays with different property values but shows us accessing the different arrays.  &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
string_css += 'display: ' + displayTypes[random.randint(0, 3)] + ';\r\n'&lt;br /&gt;
string_css += 'background-color: rgb(' + str(random.randint(0, 255)) + ',' + str(random.randint(0, 255)) + ',' + str(random.randint(0, 255)) +');\r\n'&lt;br /&gt;
string_css += 'float: ' + floatTypes[random.randint(0, 3)] + ';\r\n'&lt;br /&gt;
string_css += 'padding: ' + str(random.randint(0, 20)) + 'px ' + str(random.randint(0, 20)) + 'px ' + str(random.randint(0, 20)) + 'px ' + str(random.randint(0, 20)) + 'px;\r\n'&lt;br /&gt;
string_css += 'margin: ' + str(random.randint(0, 20)) + 'px ' + str(random.randint(0, 20)) + 'px ' + str(random.randint(0, 20)) + 'px ' + str(random.randint(0, 20)) + 'px;\r\n'&lt;br /&gt;
string_css += 'border-width: ' + str(random.randint(0, 20)) + 'px ' + str(random.randint(0, 20)) + 'px ' + str(random.randint(0, 20)) + 'px ' + str(random.randint(0, 20)) + 'px;\r\n'&lt;br /&gt;
string_css += 'border-style: ' + borderTypes[random.randint(0, 4)] + ';\r\n'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Extending the set of elements that can be generated (span, div, header elements, table (and associated table contents), etc.)&lt;br /&gt;
:Separate functions were added to create a span, div, table, ordered list, unordered list, and table. Because a span element is in-line and used typically to label a small chunk of text, the RandomSpan function is called at random within the RandomSentence function. Previously, the RandomSentence function simply called RandomWord a random number of times to create a sentence. To add in a span a small percentage of the time, a variable was given a random integer value between 0-99. If the variable was less than 5, RandomSpan was called, else RandomWord was called. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#generate a random sentence using random range function&lt;br /&gt;
def RandomSentence():&lt;br /&gt;
    global count&lt;br /&gt;
    num_of_words = random.randrange(5, 20)&lt;br /&gt;
    yield RandomWord()&lt;br /&gt;
    for _ in range(num_of_words-1):&lt;br /&gt;
        #1 in 20 words will be within a span&lt;br /&gt;
        z= random.randrange(0,99)&lt;br /&gt;
        if z&amp;lt;5:&lt;br /&gt;
            yield ' '&lt;br /&gt;
            yield ''.join(RandomSpan())&lt;br /&gt;
        else:&lt;br /&gt;
            yield ' '&lt;br /&gt;
            yield ''.join(RandomWord())&lt;br /&gt;
    yield '. '&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The other newly added element types- divs, tables, lists- are called at random within the NestedElement function discussed above. These functions utilize the RandomWord and RandomSentence functions to create their elements. For example, see the RandomTable function below:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def RandomTable():&lt;br /&gt;
    column_count = random.randrange(1,10)&lt;br /&gt;
    row_count = random.randrange(2,20)&lt;br /&gt;
    yield '&amp;lt;table&amp;gt;\r\n'&lt;br /&gt;
    #generate table head&lt;br /&gt;
    yield '\t&amp;lt;tr&amp;gt;\r\n\t\t'&lt;br /&gt;
    for _ in range(column_count):&lt;br /&gt;
        yield '&amp;lt;th&amp;gt;'&lt;br /&gt;
        yield RandomWord()&lt;br /&gt;
        yield '&amp;lt;/th&amp;gt;\r\n'&lt;br /&gt;
    yield '\t&amp;lt;/tr&amp;gt;'&lt;br /&gt;
    #fill in rows&lt;br /&gt;
    for _ in range(row_count-1):&lt;br /&gt;
        yield '\t&amp;lt;tr&amp;gt;\r\n\t\t'&lt;br /&gt;
        for _ in range(column_count):&lt;br /&gt;
            yield '&amp;lt;td&amp;gt;'&lt;br /&gt;
            yield str(random.randrange(0,1000))&lt;br /&gt;
            yield '&amp;lt;/td&amp;gt;'&lt;br /&gt;
        yield '\r\n\t&amp;lt;/tr&amp;gt;\r\n'&lt;br /&gt;
    yield '&amp;lt;/table&amp;gt;\r\n'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Randomly choose whether to generate a document in quirks mode or not&lt;br /&gt;
:Quirks mode is enable whenever an HTML document does not have a DOCTYPE.  To randomly enable Quirks mode we only added a DOCTYPE 50% of the time.  Below is the code:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
quirksMode = random.randint(0,1)&lt;br /&gt;
if quirksMode == 1 or quirks_mode_possible == False:&lt;br /&gt;
    yield '&amp;lt;!DOCTYPE html&amp;gt;'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Testing==&lt;br /&gt;
Because of the nature of this project, testing the newly added features will be very simple. &lt;br /&gt;
: * For task 1, once we are actually controlling Firefox using geckodriver we know its working (by getting a resulting screenshot).  &lt;br /&gt;
: * Task 2 actually involves us comparing screenshots.  By running the code with images that are the same and images that are different, we have proven that this comparison works.   &lt;br /&gt;
: * Additionally, we have visually tested that task 3 is complete (seeing that the new page generation features work).  While we could probably automate some of the testing for task 2 and 3 (to test all possible scenarios) it is out of the scope of this project.&lt;br /&gt;
&lt;br /&gt;
==Conclusion==&lt;br /&gt;
The previously completed work allows us to generate simple html documents with a randomized structure, render the page in Servo, and take a screenshot of the page. This project furthered this work by rendering the pages in both Servo and Firefox, taking screenshots of the pages within both browsers, and reporting differences between the two.  This project also expanded on the random content generator.  This work will now allow users to evaluate Servo’s ability to load web pages. To make this testing even more informative.&lt;/div&gt;</summary>
		<author><name>Adsimps3</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2018-_Project_M1803:_Implement_a_web_page_fuzzer_to_find_rendering_mismatches_(Part_2)&amp;diff=117074</id>
		<title>CSC/ECE 517 Spring 2018- Project M1803: Implement a web page fuzzer to find rendering mismatches (Part 2)</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2018-_Project_M1803:_Implement_a_web_page_fuzzer_to_find_rendering_mismatches_(Part_2)&amp;diff=117074"/>
		<updated>2018-04-27T21:33:23Z</updated>

		<summary type="html">&lt;p&gt;Adsimps3: /* 3) Extend the page generation tool with a bunch of additional strategies, such as: */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;By Alexander Simpson(adsimps3), Abhay Soni (asoni3), Dileep badveli (dbadvel) and Jake Batty(jbatty)&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
This Mozilla project was broken in to 2 main parts: the previous work and the work to be done.  The previous work was finished as a part of the OSS project.  As a part of the OSS project (explained more below) we created a tool which generates random valid HTML files and automated servo.  [https://en.wikipedia.org/wiki/Servo_(layout_engine) Servo] is experimental web browser developed by Mozilla to &amp;quot;to create a new layout engine using a modern programming language&amp;quot;.  By automating servo (the web browser) we were able to quickly see if servo could render the randomly generated pages.  &lt;br /&gt;
&lt;br /&gt;
The goal of this final project was to build off the original project while adding more features.  The work we completed as a part of this project is split into a couple main parts.  First, we extended the program created in the OSS project to also control Firefox.  By also controlling Firefox, we then had 2 screenshots of the randomly generated content - Servo and Firefox .  After getting both screenshots, we then compared them using Python and OpenCV.  Finally, we were able to expand upon the page generation tool to allow the randomly generated web pages to have more properties/be more complex.&lt;br /&gt;
&lt;br /&gt;
==Previous Work (Part of the OSS Project)==&lt;br /&gt;
&lt;br /&gt;
As per the [https://github.com/servo/servo/wiki/Random-web-content-project project description], we were expected to complete the initial steps. The implementation is explained below for each of these steps.&lt;br /&gt;
&lt;br /&gt;
:1) In a new repository, create a program that can generate a skeleton HTML file with a doctype, head element, and body element, print the result to stdout&lt;br /&gt;
::- Here is the [https://github.com/asoni3/Random-web-content-generator---CSC-517-OSS-Project link] to the repository which contains code_generation.py file which will be used to generate random valid HTML files.&lt;br /&gt;
:2) Add a module to the program that enable generating random content specific to the &amp;lt;head&amp;gt; element (such as inline CSS content inside of a &amp;lt;style&amp;gt; element) and add it to the generated output&lt;br /&gt;
::- The file [https://github.com/asoni3/Random-web-content-generator---CSC-517-OSS-Project/blob/master/code_generation.py code_generation.py], contains the code which generates random content specific to the head element and adds style on top of it. As seen in this code, after generating random content to the file, we will add CSS elements on top of this content. We have established a list of commonly used styles, weights, fonts, font_styles, and alignments which will be used at random. For practical purposes, we are limiting the number of options.&lt;br /&gt;
:3) Add a module to the program that enables generating random content specific to the &amp;lt;body&amp;gt; element (such as a &amp;lt;p&amp;gt; block that contains randomly generated text) and add it to the generated output&lt;br /&gt;
:4) Generate simple random CSS that affects randomly generated content (ie. if there is an element with an id foo, generate a CSS selector like #foo that applies a style like colorto it)&lt;br /&gt;
:5) Create a program under Servo's etc/ that launches Servo and causes it to [https://github.com/servo/servo/wiki/Control-Servo-using-WebDriver take a screenshot] of a particular URL - use this to take screenshots of pages randomly generated by the previous program&lt;br /&gt;
:Sample Screenshot:&lt;br /&gt;
:[[File:Servoscreenshot.png|border]]&lt;br /&gt;
&lt;br /&gt;
==Lists of Tasks==&lt;br /&gt;
Below is a list of the tasks that were completed as a part of our final project.  Below each task we have described how exactly it was implemented with code examples.   &lt;br /&gt;
 &lt;br /&gt;
:'''1) Extend the program that controls Servo to also control Firefox using geckodriver'''&lt;br /&gt;
Task 1 is relatively simple.  It just involves downloading geckodriver and running it.  Geckodriver is an open source software engine that allows us to render marked content on a web browser.  It should allow us to take screenshots of a particular URL, just like task 5 in the previous work section, but for Firefox instead.  &lt;br /&gt;
&lt;br /&gt;
:'''2) Compare the resulting screenshots and report the contents of the generated page if the screenshots differ'''&lt;br /&gt;
This task involves automating Firefox to use geckodriver and the current servo program.  They both will create 2 different screenshots.  If servo and Firefox render it differently, we will report that file and mark the differences.  &lt;br /&gt;
&lt;br /&gt;
:'''3) Extend the page generation tool with a bunch of additional strategies, such as:'''&lt;br /&gt;
:-Generating elements trees of arbitrary depth&lt;br /&gt;
:-Generating sibling elements&lt;br /&gt;
:-Extending the set of CSS properties that can be generated (display, background, float, padding, margin, border, etc.)&lt;br /&gt;
:-Extending the set of elements that can be generated (span, div, header elements, table (and associated table contents), etc.)&lt;br /&gt;
:-Randomly choose whether to generate a document in quirks mode or not&lt;br /&gt;
&lt;br /&gt;
:'''UML Diagram of Tasks:'''&lt;br /&gt;
Below is a UML diagram of the tasks of the overall system.  As you can see, it covers all 3 tasks.  It starts with the code generation and then it splits and takes screenshots on both Firefox and Servo.  It then compares then screenshots and reports the distance.&lt;br /&gt;
:[[File:UMLDiag.jpg|border|]]&lt;br /&gt;
&lt;br /&gt;
==Implementation of Tasks==&lt;br /&gt;
====1) Extend the program that controls Servo to also control Firefox using geckodriver====&lt;br /&gt;
&lt;br /&gt;
====2) Compare the resulting screenshots and report the contents of the generated page if the screenshots differ====&lt;br /&gt;
:To actually make the comparisons we use [https://opencv.org/ OpenCV].  OpenCV allows us to not only make comparisons but will also mark where the differences in.  To actually do the comparisons we will first read in the images, convert the images to grayscale, and then call compare_ssim().  &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
imageA = cv2.imread(image1)&lt;br /&gt;
imageB = cv2.imread(image2)&lt;br /&gt;
grayA = cv2.cvtColor(imageA, cv2.COLOR_BGR2GRAY)&lt;br /&gt;
grayB = cv2.cvtColor(imageB, cv2.COLOR_BGR2GRAY)&lt;br /&gt;
(score, diff) = compare_ssim(grayA, grayB, full=True)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This gets us a ''score'' and diff ''values''.  The ''score'' variables represents how close the to images are to each other and the ''diff'' variables tells us where the differences are.  If the ''score'' indicates that the images are different we then use the ''diff'' value to findContours() and then draw a rectangle around the differences.  &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
thresh = cv2.threshold(diff, 0, 255, cv2.THRESH_BINARY_INV | cv2.THRESH_OTSU)[1]&lt;br /&gt;
contours = cv2.findContours(thresh.copy(), cv2.RETR_EXTERNAL, cv2.CHAIN_APPROX_SIMPLE)&lt;br /&gt;
contours = contours[0] if imutils.is_cv2() else contours[1]&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After getting contours, we get a rectangle for each contour by calling &amp;quot;(x, y, w, h) = cv2.boundingRect(c)&amp;quot;.  We then combine any rectangles that are inside each other or very close to each other.  After combining the rectangles, we then add the rectangles to each image.  Lastly we then save image A (with the rectangles to show the differences)&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
for rrr in rectangles:&lt;br /&gt;
    x = rrr[0]&lt;br /&gt;
    y = rrr[1]&lt;br /&gt;
    w = rrr[2]&lt;br /&gt;
    h = rrr[3]             &lt;br /&gt;
    cv2.rectangle(imageA, (x, y), (x + w, y + h), (0, 0, 255), 2)&lt;br /&gt;
    cv2.rectangle(imageB, (x, y), (x + w, y + h), (0, 0, 255), 2)&lt;br /&gt;
cv2.imwrite(filename,imageA)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====3) Extend the page generation tool with a bunch of additional strategies, such as:====&lt;br /&gt;
:For task 3 there are several different parts, but the main goal was to increase the complexity of our randomly generated pages. The code_generation.py file was adapted to provide these functions.  The implementation of each subtask is explained below.  &lt;br /&gt;
&lt;br /&gt;
'''Generating elements trees of arbitrary depth and Generating sibling elements&lt;br /&gt;
:We understood a tree of elements to mean divs inside of each other.  By using this definition, it was quite simple to create a tree of elements.  When RandomDiv is called we don't just return a div with a random section.  We also recursively call RandomDiv a random amount of times.  We also may call RandomDiv several time on the same level of the tree.  This effectively creates sibling elements.  Below is the code for RandomDiv.   &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
numDivs = random.randint(1,num_sibling_divs)&lt;br /&gt;
for i in range(0, numDivs):&lt;br /&gt;
    yield '&amp;lt;div id=&amp;quot;a'+str(random.randrange(0,count[0]))+'&amp;quot;&amp;gt;\r\n'&lt;br /&gt;
    yield RandomSection(count, max_depth, num_sibling_divs, tree_height, max_headers, min_headers)&lt;br /&gt;
    if tree_height &amp;gt; 0:&lt;br /&gt;
        treeHeight = random.randint(0, tree_height)&lt;br /&gt;
        if treeHeight &amp;gt; 0:&lt;br /&gt;
            yield RandomDiv(treeHeight - 1, count, max_depth, num_sibling_divs, max_headers, min_headers)          &lt;br /&gt;
    yield '&amp;lt;/div&amp;gt;'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Extending the set of CSS properties that can be generated (display, background, float, padding, margin, border, etc.)&lt;br /&gt;
:Implementing this was relatively simple.  We just did the same thing we did before but with more CSS properties.  Below is the code we used to do this.  It does not include creating the arrays with different property values but shows us accessing the different arrays.  &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
string_css += 'display: ' + displayTypes[random.randint(0, 3)] + ';\r\n'&lt;br /&gt;
string_css += 'background-color: rgb(' + str(random.randint(0, 255)) + ',' + str(random.randint(0, 255)) + ',' + str(random.randint(0, 255)) +');\r\n'&lt;br /&gt;
string_css += 'float: ' + floatTypes[random.randint(0, 3)] + ';\r\n'&lt;br /&gt;
string_css += 'padding: ' + str(random.randint(0, 20)) + 'px ' + str(random.randint(0, 20)) + 'px ' + str(random.randint(0, 20)) + 'px ' + str(random.randint(0, 20)) + 'px;\r\n'&lt;br /&gt;
string_css += 'margin: ' + str(random.randint(0, 20)) + 'px ' + str(random.randint(0, 20)) + 'px ' + str(random.randint(0, 20)) + 'px ' + str(random.randint(0, 20)) + 'px;\r\n'&lt;br /&gt;
string_css += 'border-width: ' + str(random.randint(0, 20)) + 'px ' + str(random.randint(0, 20)) + 'px ' + str(random.randint(0, 20)) + 'px ' + str(random.randint(0, 20)) + 'px;\r\n'&lt;br /&gt;
string_css += 'border-style: ' + borderTypes[random.randint(0, 4)] + ';\r\n'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Extending the set of elements that can be generated (span, div, header elements, table (and associated table contents), etc.)&lt;br /&gt;
::::JAKE WILL YOU ADD THIS&lt;br /&gt;
'''Randomly choose whether to generate a document in quirks mode or not&lt;br /&gt;
:Quirks mode is enable whenever an HTML document does not have a DOCTYPE.  To randomly enable Quirks mode we only added a DOCTYPE 50% of the time.  Below is the code:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
quirksMode = random.randint(0,1)&lt;br /&gt;
if quirksMode == 1 or quirks_mode_possible == False:&lt;br /&gt;
    yield '&amp;lt;!DOCTYPE html&amp;gt;'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Testing==&lt;br /&gt;
Because of the nature of this project, testing the newly added features will be very simple. &lt;br /&gt;
: * For task 1, once we are actually controlling Firefox using geckodriver we know its working (by getting a resulting screenshot).  &lt;br /&gt;
: * Task 2 actually involves us comparing screenshots.  By running the code with images that are the same and images that are different, we have proven that this comparison works.   &lt;br /&gt;
: * Additionally, we have visually tested that task 3 is complete (seeing that the new page generation features work).  While we could probably automate some of the testing for task 2 and 3 (to test all possible scenarios) it is out of the scope of this project.&lt;br /&gt;
&lt;br /&gt;
==Conclusion==&lt;br /&gt;
The previously completed work allows us to generate simple html documents with a randomized structure, render the page in Servo, and take a screenshot of the page. This project furthered this work by rendering the pages in both Servo and Firefox, taking screenshots of the pages within both browsers, and reporting differences between the two.  This project also expanded on the random content generator.  This work will now allow users to evaluate Servo’s ability to load web pages. To make this testing even more informative.&lt;/div&gt;</summary>
		<author><name>Adsimps3</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2018-_Project_M1803:_Implement_a_web_page_fuzzer_to_find_rendering_mismatches_(Part_2)&amp;diff=117073</id>
		<title>CSC/ECE 517 Spring 2018- Project M1803: Implement a web page fuzzer to find rendering mismatches (Part 2)</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2018-_Project_M1803:_Implement_a_web_page_fuzzer_to_find_rendering_mismatches_(Part_2)&amp;diff=117073"/>
		<updated>2018-04-27T21:32:50Z</updated>

		<summary type="html">&lt;p&gt;Adsimps3: /* 3) Extend the page generation tool with a bunch of additional strategies, such as: */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;By Alexander Simpson(adsimps3), Abhay Soni (asoni3), Dileep badveli (dbadvel) and Jake Batty(jbatty)&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
This Mozilla project was broken in to 2 main parts: the previous work and the work to be done.  The previous work was finished as a part of the OSS project.  As a part of the OSS project (explained more below) we created a tool which generates random valid HTML files and automated servo.  [https://en.wikipedia.org/wiki/Servo_(layout_engine) Servo] is experimental web browser developed by Mozilla to &amp;quot;to create a new layout engine using a modern programming language&amp;quot;.  By automating servo (the web browser) we were able to quickly see if servo could render the randomly generated pages.  &lt;br /&gt;
&lt;br /&gt;
The goal of this final project was to build off the original project while adding more features.  The work we completed as a part of this project is split into a couple main parts.  First, we extended the program created in the OSS project to also control Firefox.  By also controlling Firefox, we then had 2 screenshots of the randomly generated content - Servo and Firefox .  After getting both screenshots, we then compared them using Python and OpenCV.  Finally, we were able to expand upon the page generation tool to allow the randomly generated web pages to have more properties/be more complex.&lt;br /&gt;
&lt;br /&gt;
==Previous Work (Part of the OSS Project)==&lt;br /&gt;
&lt;br /&gt;
As per the [https://github.com/servo/servo/wiki/Random-web-content-project project description], we were expected to complete the initial steps. The implementation is explained below for each of these steps.&lt;br /&gt;
&lt;br /&gt;
:1) In a new repository, create a program that can generate a skeleton HTML file with a doctype, head element, and body element, print the result to stdout&lt;br /&gt;
::- Here is the [https://github.com/asoni3/Random-web-content-generator---CSC-517-OSS-Project link] to the repository which contains code_generation.py file which will be used to generate random valid HTML files.&lt;br /&gt;
:2) Add a module to the program that enable generating random content specific to the &amp;lt;head&amp;gt; element (such as inline CSS content inside of a &amp;lt;style&amp;gt; element) and add it to the generated output&lt;br /&gt;
::- The file [https://github.com/asoni3/Random-web-content-generator---CSC-517-OSS-Project/blob/master/code_generation.py code_generation.py], contains the code which generates random content specific to the head element and adds style on top of it. As seen in this code, after generating random content to the file, we will add CSS elements on top of this content. We have established a list of commonly used styles, weights, fonts, font_styles, and alignments which will be used at random. For practical purposes, we are limiting the number of options.&lt;br /&gt;
:3) Add a module to the program that enables generating random content specific to the &amp;lt;body&amp;gt; element (such as a &amp;lt;p&amp;gt; block that contains randomly generated text) and add it to the generated output&lt;br /&gt;
:4) Generate simple random CSS that affects randomly generated content (ie. if there is an element with an id foo, generate a CSS selector like #foo that applies a style like colorto it)&lt;br /&gt;
:5) Create a program under Servo's etc/ that launches Servo and causes it to [https://github.com/servo/servo/wiki/Control-Servo-using-WebDriver take a screenshot] of a particular URL - use this to take screenshots of pages randomly generated by the previous program&lt;br /&gt;
:Sample Screenshot:&lt;br /&gt;
:[[File:Servoscreenshot.png|border]]&lt;br /&gt;
&lt;br /&gt;
==Lists of Tasks==&lt;br /&gt;
Below is a list of the tasks that were completed as a part of our final project.  Below each task we have described how exactly it was implemented with code examples.   &lt;br /&gt;
 &lt;br /&gt;
:'''1) Extend the program that controls Servo to also control Firefox using geckodriver'''&lt;br /&gt;
Task 1 is relatively simple.  It just involves downloading geckodriver and running it.  Geckodriver is an open source software engine that allows us to render marked content on a web browser.  It should allow us to take screenshots of a particular URL, just like task 5 in the previous work section, but for Firefox instead.  &lt;br /&gt;
&lt;br /&gt;
:'''2) Compare the resulting screenshots and report the contents of the generated page if the screenshots differ'''&lt;br /&gt;
This task involves automating Firefox to use geckodriver and the current servo program.  They both will create 2 different screenshots.  If servo and Firefox render it differently, we will report that file and mark the differences.  &lt;br /&gt;
&lt;br /&gt;
:'''3) Extend the page generation tool with a bunch of additional strategies, such as:'''&lt;br /&gt;
:-Generating elements trees of arbitrary depth&lt;br /&gt;
:-Generating sibling elements&lt;br /&gt;
:-Extending the set of CSS properties that can be generated (display, background, float, padding, margin, border, etc.)&lt;br /&gt;
:-Extending the set of elements that can be generated (span, div, header elements, table (and associated table contents), etc.)&lt;br /&gt;
:-Randomly choose whether to generate a document in quirks mode or not&lt;br /&gt;
&lt;br /&gt;
:'''UML Diagram of Tasks:'''&lt;br /&gt;
Below is a UML diagram of the tasks of the overall system.  As you can see, it covers all 3 tasks.  It starts with the code generation and then it splits and takes screenshots on both Firefox and Servo.  It then compares then screenshots and reports the distance.&lt;br /&gt;
:[[File:UMLDiag.jpg|border|]]&lt;br /&gt;
&lt;br /&gt;
==Implementation of Tasks==&lt;br /&gt;
====1) Extend the program that controls Servo to also control Firefox using geckodriver====&lt;br /&gt;
&lt;br /&gt;
====2) Compare the resulting screenshots and report the contents of the generated page if the screenshots differ====&lt;br /&gt;
:To actually make the comparisons we use [https://opencv.org/ OpenCV].  OpenCV allows us to not only make comparisons but will also mark where the differences in.  To actually do the comparisons we will first read in the images, convert the images to grayscale, and then call compare_ssim().  &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
imageA = cv2.imread(image1)&lt;br /&gt;
imageB = cv2.imread(image2)&lt;br /&gt;
grayA = cv2.cvtColor(imageA, cv2.COLOR_BGR2GRAY)&lt;br /&gt;
grayB = cv2.cvtColor(imageB, cv2.COLOR_BGR2GRAY)&lt;br /&gt;
(score, diff) = compare_ssim(grayA, grayB, full=True)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This gets us a ''score'' and diff ''values''.  The ''score'' variables represents how close the to images are to each other and the ''diff'' variables tells us where the differences are.  If the ''score'' indicates that the images are different we then use the ''diff'' value to findContours() and then draw a rectangle around the differences.  &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
thresh = cv2.threshold(diff, 0, 255, cv2.THRESH_BINARY_INV | cv2.THRESH_OTSU)[1]&lt;br /&gt;
contours = cv2.findContours(thresh.copy(), cv2.RETR_EXTERNAL, cv2.CHAIN_APPROX_SIMPLE)&lt;br /&gt;
contours = contours[0] if imutils.is_cv2() else contours[1]&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After getting contours, we get a rectangle for each contour by calling &amp;quot;(x, y, w, h) = cv2.boundingRect(c)&amp;quot;.  We then combine any rectangles that are inside each other or very close to each other.  After combining the rectangles, we then add the rectangles to each image.  Lastly we then save image A (with the rectangles to show the differences)&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
for rrr in rectangles:&lt;br /&gt;
    x = rrr[0]&lt;br /&gt;
    y = rrr[1]&lt;br /&gt;
    w = rrr[2]&lt;br /&gt;
    h = rrr[3]             &lt;br /&gt;
    cv2.rectangle(imageA, (x, y), (x + w, y + h), (0, 0, 255), 2)&lt;br /&gt;
    cv2.rectangle(imageB, (x, y), (x + w, y + h), (0, 0, 255), 2)&lt;br /&gt;
cv2.imwrite(filename,imageA)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====3) Extend the page generation tool with a bunch of additional strategies, such as:====&lt;br /&gt;
:For task 3 there are several different parts, but the main goal was to increase the complexity of our randomly generated pages. The code_generation.py file was adapted to provide these functions.  The implementation of each subtask is explained below.  &lt;br /&gt;
&lt;br /&gt;
'''Generating elements trees of arbitrary depth and Generating sibling elements&lt;br /&gt;
:We understood a tree of elements to mean divs inside of each other.  By using this definition, it was quite simple to create a tree of elements.  When RandomDiv is called we don't just return a div with a random section.  We also recursively call RandomDiv a random amount of times.  We also may call RandomDiv several time on the same level of the tree.  This effectively creates sibling elements.  Below is the code for RandomDiv.   &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
numDivs = random.randint(1,num_sibling_divs)&lt;br /&gt;
for i in range(0, numDivs):&lt;br /&gt;
    yield '&amp;lt;div id=&amp;quot;a'+str(random.randrange(0,count[0]))+'&amp;quot;&amp;gt;\r\n'&lt;br /&gt;
    yield RandomSection(count, max_depth, num_sibling_divs, tree_height, max_headers, min_headers)&lt;br /&gt;
    if tree_height &amp;gt; 0:&lt;br /&gt;
        treeHeight = random.randint(0, tree_height)&lt;br /&gt;
        if treeHeight &amp;gt; 0:&lt;br /&gt;
            yield RandomDiv(treeHeight - 1, count, max_depth, num_sibling_divs, max_headers, min_headers)          &lt;br /&gt;
    yield '&amp;lt;/div&amp;gt;'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Extending the set of CSS properties that can be generated (display, background, float, padding, margin, border, etc.)&lt;br /&gt;
:Implementing this was relatively simple.  We just did the same thing we did before but with more CSS properties.  Below is the code we used to do this.  It does not include creating the arrays with different property values but shows us accessing the different arrays.  &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
string_css += 'display: ' + displayTypes[random.randint(0, 3)] + ';\r\n'&lt;br /&gt;
string_css += 'background-color: rgb(' + str(random.randint(0, 255)) + ',' + str(random.randint(0, 255)) + ',' + str(random.randint(0, 255)) +');\r\n'&lt;br /&gt;
string_css += 'float: ' + floatTypes[random.randint(0, 3)] + ';\r\n'&lt;br /&gt;
string_css += 'padding: ' + str(random.randint(0, 20)) + 'px ' + str(random.randint(0, 20)) + 'px ' + str(random.randint(0, 20)) + 'px ' + str(random.randint(0, 20)) + 'px;\r\n'&lt;br /&gt;
string_css += 'margin: ' + str(random.randint(0, 20)) + 'px ' + str(random.randint(0, 20)) + 'px ' + str(random.randint(0, 20)) + 'px ' + str(random.randint(0, 20)) + 'px;\r\n'&lt;br /&gt;
string_css += 'border-width: ' + str(random.randint(0, 20)) + 'px ' + str(random.randint(0, 20)) + 'px ' + str(random.randint(0, 20)) + 'px ' + str(random.randint(0, 20)) + 'px;\r\n'&lt;br /&gt;
string_css += 'border-style: ' + borderTypes[random.randint(0, 4)] + ';\r\n'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Extending the set of elements that can be generated (span, div, header elements, table (and associated table contents), etc.)&lt;br /&gt;
:&lt;br /&gt;
'''Randomly choose whether to generate a document in quirks mode or not&lt;br /&gt;
:Quirks mode is enable whenever an HTML document does not have a DOCTYPE.  To randomly enable Quirks mode we only added a DOCTYPE 50% of the time.  Below is the code:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
quirksMode = random.randint(0,1)&lt;br /&gt;
if quirksMode == 1 or quirks_mode_possible == False:&lt;br /&gt;
    yield '&amp;lt;!DOCTYPE html&amp;gt;'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Testing==&lt;br /&gt;
Because of the nature of this project, testing the newly added features will be very simple. &lt;br /&gt;
: * For task 1, once we are actually controlling Firefox using geckodriver we know its working (by getting a resulting screenshot).  &lt;br /&gt;
: * Task 2 actually involves us comparing screenshots.  By running the code with images that are the same and images that are different, we have proven that this comparison works.   &lt;br /&gt;
: * Additionally, we have visually tested that task 3 is complete (seeing that the new page generation features work).  While we could probably automate some of the testing for task 2 and 3 (to test all possible scenarios) it is out of the scope of this project.&lt;br /&gt;
&lt;br /&gt;
==Conclusion==&lt;br /&gt;
The previously completed work allows us to generate simple html documents with a randomized structure, render the page in Servo, and take a screenshot of the page. This project furthered this work by rendering the pages in both Servo and Firefox, taking screenshots of the pages within both browsers, and reporting differences between the two.  This project also expanded on the random content generator.  This work will now allow users to evaluate Servo’s ability to load web pages. To make this testing even more informative.&lt;/div&gt;</summary>
		<author><name>Adsimps3</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2018-_Project_M1803:_Implement_a_web_page_fuzzer_to_find_rendering_mismatches_(Part_2)&amp;diff=117072</id>
		<title>CSC/ECE 517 Spring 2018- Project M1803: Implement a web page fuzzer to find rendering mismatches (Part 2)</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2018-_Project_M1803:_Implement_a_web_page_fuzzer_to_find_rendering_mismatches_(Part_2)&amp;diff=117072"/>
		<updated>2018-04-27T21:31:56Z</updated>

		<summary type="html">&lt;p&gt;Adsimps3: /* Implementation of Tasks */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;By Alexander Simpson(adsimps3), Abhay Soni (asoni3), Dileep badveli (dbadvel) and Jake Batty(jbatty)&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
This Mozilla project was broken in to 2 main parts: the previous work and the work to be done.  The previous work was finished as a part of the OSS project.  As a part of the OSS project (explained more below) we created a tool which generates random valid HTML files and automated servo.  [https://en.wikipedia.org/wiki/Servo_(layout_engine) Servo] is experimental web browser developed by Mozilla to &amp;quot;to create a new layout engine using a modern programming language&amp;quot;.  By automating servo (the web browser) we were able to quickly see if servo could render the randomly generated pages.  &lt;br /&gt;
&lt;br /&gt;
The goal of this final project was to build off the original project while adding more features.  The work we completed as a part of this project is split into a couple main parts.  First, we extended the program created in the OSS project to also control Firefox.  By also controlling Firefox, we then had 2 screenshots of the randomly generated content - Servo and Firefox .  After getting both screenshots, we then compared them using Python and OpenCV.  Finally, we were able to expand upon the page generation tool to allow the randomly generated web pages to have more properties/be more complex.&lt;br /&gt;
&lt;br /&gt;
==Previous Work (Part of the OSS Project)==&lt;br /&gt;
&lt;br /&gt;
As per the [https://github.com/servo/servo/wiki/Random-web-content-project project description], we were expected to complete the initial steps. The implementation is explained below for each of these steps.&lt;br /&gt;
&lt;br /&gt;
:1) In a new repository, create a program that can generate a skeleton HTML file with a doctype, head element, and body element, print the result to stdout&lt;br /&gt;
::- Here is the [https://github.com/asoni3/Random-web-content-generator---CSC-517-OSS-Project link] to the repository which contains code_generation.py file which will be used to generate random valid HTML files.&lt;br /&gt;
:2) Add a module to the program that enable generating random content specific to the &amp;lt;head&amp;gt; element (such as inline CSS content inside of a &amp;lt;style&amp;gt; element) and add it to the generated output&lt;br /&gt;
::- The file [https://github.com/asoni3/Random-web-content-generator---CSC-517-OSS-Project/blob/master/code_generation.py code_generation.py], contains the code which generates random content specific to the head element and adds style on top of it. As seen in this code, after generating random content to the file, we will add CSS elements on top of this content. We have established a list of commonly used styles, weights, fonts, font_styles, and alignments which will be used at random. For practical purposes, we are limiting the number of options.&lt;br /&gt;
:3) Add a module to the program that enables generating random content specific to the &amp;lt;body&amp;gt; element (such as a &amp;lt;p&amp;gt; block that contains randomly generated text) and add it to the generated output&lt;br /&gt;
:4) Generate simple random CSS that affects randomly generated content (ie. if there is an element with an id foo, generate a CSS selector like #foo that applies a style like colorto it)&lt;br /&gt;
:5) Create a program under Servo's etc/ that launches Servo and causes it to [https://github.com/servo/servo/wiki/Control-Servo-using-WebDriver take a screenshot] of a particular URL - use this to take screenshots of pages randomly generated by the previous program&lt;br /&gt;
:Sample Screenshot:&lt;br /&gt;
:[[File:Servoscreenshot.png|border]]&lt;br /&gt;
&lt;br /&gt;
==Lists of Tasks==&lt;br /&gt;
Below is a list of the tasks that were completed as a part of our final project.  Below each task we have described how exactly it was implemented with code examples.   &lt;br /&gt;
 &lt;br /&gt;
:'''1) Extend the program that controls Servo to also control Firefox using geckodriver'''&lt;br /&gt;
Task 1 is relatively simple.  It just involves downloading geckodriver and running it.  Geckodriver is an open source software engine that allows us to render marked content on a web browser.  It should allow us to take screenshots of a particular URL, just like task 5 in the previous work section, but for Firefox instead.  &lt;br /&gt;
&lt;br /&gt;
:'''2) Compare the resulting screenshots and report the contents of the generated page if the screenshots differ'''&lt;br /&gt;
This task involves automating Firefox to use geckodriver and the current servo program.  They both will create 2 different screenshots.  If servo and Firefox render it differently, we will report that file and mark the differences.  &lt;br /&gt;
&lt;br /&gt;
:'''3) Extend the page generation tool with a bunch of additional strategies, such as:'''&lt;br /&gt;
:-Generating elements trees of arbitrary depth&lt;br /&gt;
:-Generating sibling elements&lt;br /&gt;
:-Extending the set of CSS properties that can be generated (display, background, float, padding, margin, border, etc.)&lt;br /&gt;
:-Extending the set of elements that can be generated (span, div, header elements, table (and associated table contents), etc.)&lt;br /&gt;
:-Randomly choose whether to generate a document in quirks mode or not&lt;br /&gt;
&lt;br /&gt;
:'''UML Diagram of Tasks:'''&lt;br /&gt;
Below is a UML diagram of the tasks of the overall system.  As you can see, it covers all 3 tasks.  It starts with the code generation and then it splits and takes screenshots on both Firefox and Servo.  It then compares then screenshots and reports the distance.&lt;br /&gt;
:[[File:UMLDiag.jpg|border|]]&lt;br /&gt;
&lt;br /&gt;
==Implementation of Tasks==&lt;br /&gt;
====1) Extend the program that controls Servo to also control Firefox using geckodriver====&lt;br /&gt;
&lt;br /&gt;
====2) Compare the resulting screenshots and report the contents of the generated page if the screenshots differ====&lt;br /&gt;
:To actually make the comparisons we use [https://opencv.org/ OpenCV].  OpenCV allows us to not only make comparisons but will also mark where the differences in.  To actually do the comparisons we will first read in the images, convert the images to grayscale, and then call compare_ssim().  &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
imageA = cv2.imread(image1)&lt;br /&gt;
imageB = cv2.imread(image2)&lt;br /&gt;
grayA = cv2.cvtColor(imageA, cv2.COLOR_BGR2GRAY)&lt;br /&gt;
grayB = cv2.cvtColor(imageB, cv2.COLOR_BGR2GRAY)&lt;br /&gt;
(score, diff) = compare_ssim(grayA, grayB, full=True)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This gets us a ''score'' and diff ''values''.  The ''score'' variables represents how close the to images are to each other and the ''diff'' variables tells us where the differences are.  If the ''score'' indicates that the images are different we then use the ''diff'' value to findContours() and then draw a rectangle around the differences.  &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
thresh = cv2.threshold(diff, 0, 255, cv2.THRESH_BINARY_INV | cv2.THRESH_OTSU)[1]&lt;br /&gt;
contours = cv2.findContours(thresh.copy(), cv2.RETR_EXTERNAL, cv2.CHAIN_APPROX_SIMPLE)&lt;br /&gt;
contours = contours[0] if imutils.is_cv2() else contours[1]&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After getting contours, we get a rectangle for each contour by calling &amp;quot;(x, y, w, h) = cv2.boundingRect(c)&amp;quot;.  We then combine any rectangles that are inside each other or very close to each other.  After combining the rectangles, we then add the rectangles to each image.  Lastly we then save image A (with the rectangles to show the differences)&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
for rrr in rectangles:&lt;br /&gt;
    x = rrr[0]&lt;br /&gt;
    y = rrr[1]&lt;br /&gt;
    w = rrr[2]&lt;br /&gt;
    h = rrr[3]             &lt;br /&gt;
    cv2.rectangle(imageA, (x, y), (x + w, y + h), (0, 0, 255), 2)&lt;br /&gt;
    cv2.rectangle(imageB, (x, y), (x + w, y + h), (0, 0, 255), 2)&lt;br /&gt;
cv2.imwrite(filename,imageA)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====3) Extend the page generation tool with a bunch of additional strategies, such as:====&lt;br /&gt;
:For task 3 there are several different parts, but the main goal was to increase the complexity of our randomly generated pages. The code_generation.py file was adapted to provide these functions.  The implementation of each subtask is explained below.  &lt;br /&gt;
&lt;br /&gt;
'''Generating elements trees of arbitrary depth and Generating sibling elements&lt;br /&gt;
:We understood a tree of elements to mean divs inside of each other.  By using this definition, it was quite simple to create a tree of elements.  When RandomDiv is called we don't just return a div with a random section.  We also recursively call RandomDiv a random amount of times.  We also may call RandomDiv several time on the same level of the tree.  This effectively creates sibling elements.  Below is the code for RandomDiv.   &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
numDivs = random.randint(1,num_sibling_divs)&lt;br /&gt;
for i in range(0, numDivs):&lt;br /&gt;
    yield '&amp;lt;div id=&amp;quot;a'+str(random.randrange(0,count[0]))+'&amp;quot;&amp;gt;\r\n'&lt;br /&gt;
    yield RandomSection(count, max_depth, num_sibling_divs, tree_height, max_headers, min_headers)&lt;br /&gt;
    if tree_height &amp;gt; 0:&lt;br /&gt;
        treeHeight = random.randint(0, tree_height)&lt;br /&gt;
        if treeHeight &amp;gt; 0:&lt;br /&gt;
            yield RandomDiv(treeHeight - 1, count, max_depth, num_sibling_divs, max_headers, min_headers)          &lt;br /&gt;
    yield '&amp;lt;/div&amp;gt;'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Extending the set of CSS properties that can be generated (display, background, float, padding, margin, border, etc.)&lt;br /&gt;
:Implementing this was relatively simple.  We just did the same thing we did before but with more CSS properties.  Below is the code we used to do this.  It does not include creating the arrays with different property values but shows us accessing the different arrays.  &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
string_css += 'display: ' + displayTypes[random.randint(0, 3)] + ';\r\n'&lt;br /&gt;
string_css += 'background-color: rgb(' + str(random.randint(0, 255)) + ',' + str(random.randint(0, 255)) + ',' + str(random.randint(0, 255)) +');\r\n'&lt;br /&gt;
string_css += 'float: ' + floatTypes[random.randint(0, 3)] + ';\r\n'&lt;br /&gt;
string_css += 'padding: ' + str(random.randint(0, 20)) + 'px ' + str(random.randint(0, 20)) + 'px ' + str(random.randint(0, 20)) + 'px ' + str(random.randint(0, 20)) + 'px;\r\n'&lt;br /&gt;
string_css += 'margin: ' + str(random.randint(0, 20)) + 'px ' + str(random.randint(0, 20)) + 'px ' + str(random.randint(0, 20)) + 'px ' + str(random.randint(0, 20)) + 'px;\r\n'&lt;br /&gt;
string_css += 'border-width: ' + str(random.randint(0, 20)) + 'px ' + str(random.randint(0, 20)) + 'px ' + str(random.randint(0, 20)) + 'px ' + str(random.randint(0, 20)) + 'px;\r\n'&lt;br /&gt;
string_css += 'border-style: ' + borderTypes[random.randint(0, 4)] + ';\r\n'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Extending the set of elements that can be generated (span, div, header elements, table (and associated table contents), etc.)&lt;br /&gt;
:&lt;br /&gt;
'''Randomly choose whether to generate a document in quirks mode or not&lt;br /&gt;
:Quirks mode is enable whenever an HTML document does not have a DOCTYPE.  To randomly enable Quirks mode we only added a DOCTYPE 50% of the time.&lt;br /&gt;
&lt;br /&gt;
==Testing==&lt;br /&gt;
Because of the nature of this project, testing the newly added features will be very simple. &lt;br /&gt;
: * For task 1, once we are actually controlling Firefox using geckodriver we know its working (by getting a resulting screenshot).  &lt;br /&gt;
: * Task 2 actually involves us comparing screenshots.  By running the code with images that are the same and images that are different, we have proven that this comparison works.   &lt;br /&gt;
: * Additionally, we have visually tested that task 3 is complete (seeing that the new page generation features work).  While we could probably automate some of the testing for task 2 and 3 (to test all possible scenarios) it is out of the scope of this project.&lt;br /&gt;
&lt;br /&gt;
==Conclusion==&lt;br /&gt;
The previously completed work allows us to generate simple html documents with a randomized structure, render the page in Servo, and take a screenshot of the page. This project furthered this work by rendering the pages in both Servo and Firefox, taking screenshots of the pages within both browsers, and reporting differences between the two.  This project also expanded on the random content generator.  This work will now allow users to evaluate Servo’s ability to load web pages. To make this testing even more informative.&lt;/div&gt;</summary>
		<author><name>Adsimps3</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2018-_Project_M1803:_Implement_a_web_page_fuzzer_to_find_rendering_mismatches_(Part_2)&amp;diff=117067</id>
		<title>CSC/ECE 517 Spring 2018- Project M1803: Implement a web page fuzzer to find rendering mismatches (Part 2)</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2018-_Project_M1803:_Implement_a_web_page_fuzzer_to_find_rendering_mismatches_(Part_2)&amp;diff=117067"/>
		<updated>2018-04-27T21:23:05Z</updated>

		<summary type="html">&lt;p&gt;Adsimps3: /* Implementation of Tasks */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;By Alexander Simpson(adsimps3), Abhay Soni (asoni3), Dileep badveli (dbadvel) and Jake Batty(jbatty)&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
This Mozilla project was broken in to 2 main parts: the previous work and the work to be done.  The previous work was finished as a part of the OSS project.  As a part of the OSS project (explained more below) we created a tool which generates random valid HTML files and automated servo.  [https://en.wikipedia.org/wiki/Servo_(layout_engine) Servo] is experimental web browser developed by Mozilla to &amp;quot;to create a new layout engine using a modern programming language&amp;quot;.  By automating servo (the web browser) we were able to quickly see if servo could render the randomly generated pages.  &lt;br /&gt;
&lt;br /&gt;
The goal of this final project was to build off the original project while adding more features.  The work we completed as a part of this project is split into a couple main parts.  First, we extended the program created in the OSS project to also control Firefox.  By also controlling Firefox, we then had 2 screenshots of the randomly generated content - Servo and Firefox .  After getting both screenshots, we then compared them using Python and OpenCV.  Finally, we were able to expand upon the page generation tool to allow the randomly generated web pages to have more properties/be more complex.&lt;br /&gt;
&lt;br /&gt;
==Previous Work (Part of the OSS Project)==&lt;br /&gt;
&lt;br /&gt;
As per the [https://github.com/servo/servo/wiki/Random-web-content-project project description], we were expected to complete the initial steps. The implementation is explained below for each of these steps.&lt;br /&gt;
&lt;br /&gt;
:1) In a new repository, create a program that can generate a skeleton HTML file with a doctype, head element, and body element, print the result to stdout&lt;br /&gt;
::- Here is the [https://github.com/asoni3/Random-web-content-generator---CSC-517-OSS-Project link] to the repository which contains code_generation.py file which will be used to generate random valid HTML files.&lt;br /&gt;
:2) Add a module to the program that enable generating random content specific to the &amp;lt;head&amp;gt; element (such as inline CSS content inside of a &amp;lt;style&amp;gt; element) and add it to the generated output&lt;br /&gt;
::- The file [https://github.com/asoni3/Random-web-content-generator---CSC-517-OSS-Project/blob/master/code_generation.py code_generation.py], contains the code which generates random content specific to the head element and adds style on top of it. As seen in this code, after generating random content to the file, we will add CSS elements on top of this content. We have established a list of commonly used styles, weights, fonts, font_styles, and alignments which will be used at random. For practical purposes, we are limiting the number of options.&lt;br /&gt;
:3) Add a module to the program that enables generating random content specific to the &amp;lt;body&amp;gt; element (such as a &amp;lt;p&amp;gt; block that contains randomly generated text) and add it to the generated output&lt;br /&gt;
:4) Generate simple random CSS that affects randomly generated content (ie. if there is an element with an id foo, generate a CSS selector like #foo that applies a style like colorto it)&lt;br /&gt;
:5) Create a program under Servo's etc/ that launches Servo and causes it to [https://github.com/servo/servo/wiki/Control-Servo-using-WebDriver take a screenshot] of a particular URL - use this to take screenshots of pages randomly generated by the previous program&lt;br /&gt;
:Sample Screenshot:&lt;br /&gt;
:[[File:Servoscreenshot.png|border]]&lt;br /&gt;
&lt;br /&gt;
==Lists of Tasks==&lt;br /&gt;
Below is a list of the tasks that were completed as a part of our final project.  Below each task we have described how exactly it was implemented with code examples.   &lt;br /&gt;
 &lt;br /&gt;
:'''1) Extend the program that controls Servo to also control Firefox using geckodriver'''&lt;br /&gt;
Task 1 is relatively simple.  It just involves downloading geckodriver and running it.  Geckodriver is an open source software engine that allows us to render marked content on a web browser.  It should allow us to take screenshots of a particular URL, just like task 5 in the previous work section, but for Firefox instead.  &lt;br /&gt;
&lt;br /&gt;
:'''2) Compare the resulting screenshots and report the contents of the generated page if the screenshots differ'''&lt;br /&gt;
This task involves automating Firefox to use geckodriver and the current servo program.  They both will create 2 different screenshots.  If servo and Firefox render it differently, we will report that file and mark the differences.  &lt;br /&gt;
&lt;br /&gt;
:'''3) Extend the page generation tool with a bunch of additional strategies, such as:'''&lt;br /&gt;
:-Generating elements trees of arbitrary depth&lt;br /&gt;
:-Generating sibling elements&lt;br /&gt;
:-Extending the set of CSS properties that can be generated (display, background, float, padding, margin, border, etc.)&lt;br /&gt;
:-Extending the set of elements that can be generated (span, div, header elements, table (and associated table contents), etc.)&lt;br /&gt;
:-Randomly choose whether to generate a document in quirks mode or not&lt;br /&gt;
&lt;br /&gt;
:'''UML Diagram of Tasks:'''&lt;br /&gt;
Below is a UML diagram of the tasks of the overall system.  As you can see, it covers all 3 tasks.  It starts with the code generation and then it splits and takes screenshots on both Firefox and Servo.  It then compares then screenshots and reports the distance.&lt;br /&gt;
:[[File:UMLDiag.jpg|border|]]&lt;br /&gt;
&lt;br /&gt;
==Implementation of Tasks==&lt;br /&gt;
:'''1) Extend the program that controls Servo to also control Firefox using geckodriver'''&lt;br /&gt;
&lt;br /&gt;
:'''2) Compare the resulting screenshots and report the contents of the generated page if the screenshots differ'''&lt;br /&gt;
:To actually make the comparisons we use [https://opencv.org/ OpenCV].  OpenCV allows us to not only make comparisons but will also mark where the differences in.  To actually do the comparisons we will first read in the images, convert the images to grayscale, and then call compare_ssim().  &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
imageA = cv2.imread(image1)&lt;br /&gt;
imageB = cv2.imread(image2)&lt;br /&gt;
grayA = cv2.cvtColor(imageA, cv2.COLOR_BGR2GRAY)&lt;br /&gt;
grayB = cv2.cvtColor(imageB, cv2.COLOR_BGR2GRAY)&lt;br /&gt;
(score, diff) = compare_ssim(grayA, grayB, full=True)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This gets us a ''score'' and diff ''values''.  The ''score'' variables represents how close the to images are to each other and the ''diff'' variables tells us where the differences are.  If the ''score'' indicates that the images are different we then use the ''diff'' value to findContours() and then draw a rectangle around the differences.  &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
thresh = cv2.threshold(diff, 0, 255, cv2.THRESH_BINARY_INV | cv2.THRESH_OTSU)[1]&lt;br /&gt;
contours = cv2.findContours(thresh.copy(), cv2.RETR_EXTERNAL, cv2.CHAIN_APPROX_SIMPLE)&lt;br /&gt;
contours = contours[0] if imutils.is_cv2() else contours[1]&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After getting contours, we get a rectangle for each contour by calling &amp;quot;(x, y, w, h) = cv2.boundingRect(c)&amp;quot;.  We then combine any rectangles that are inside each other or very close to each other.  After combining the rectangles, we then add the rectangles to each image.  Lastly we then save image A (with the rectangles to show the differences)&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
for rrr in rectangles:&lt;br /&gt;
    x = rrr[0]&lt;br /&gt;
    y = rrr[1]&lt;br /&gt;
    w = rrr[2]&lt;br /&gt;
    h = rrr[3]             &lt;br /&gt;
    cv2.rectangle(imageA, (x, y), (x + w, y + h), (0, 0, 255), 2)&lt;br /&gt;
    cv2.rectangle(imageB, (x, y), (x + w, y + h), (0, 0, 255), 2)&lt;br /&gt;
cv2.imwrite(filename,imageA)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
:'''3) Extend the page generation tool with a bunch of additional strategies, such as:'''&lt;br /&gt;
:For task 3 there are several different parts, but the main goal was to increase the complexity of our randomly generated pages. The code_generation.py file was adapted to provide these functions.  The implementation of each subtask is explained below.  &lt;br /&gt;
&lt;br /&gt;
'''Generating elements trees of arbitrary depth&lt;br /&gt;
:this&lt;br /&gt;
&lt;br /&gt;
'''Generating sibling elements&lt;br /&gt;
:&lt;br /&gt;
'''Extending the set of CSS properties that can be generated (display, background, float, padding, margin, border, etc.)&lt;br /&gt;
:Implementing this was relatively simple.  We just did the same thing we did before but with more CSS properties.  Below is the code we used to do this.  It does not include creating the arrays with different property values but shows us accessing the different arrays.  &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
string_css += 'display: ' + displayTypes[random.randint(0, 3)] + ';\r\n'&lt;br /&gt;
string_css += 'background-color: rgb(' + str(random.randint(0, 255)) + ',' + str(random.randint(0, 255)) + ',' + str(random.randint(0, 255)) +');\r\n'&lt;br /&gt;
string_css += 'float: ' + floatTypes[random.randint(0, 3)] + ';\r\n'&lt;br /&gt;
string_css += 'padding: ' + str(random.randint(0, 20)) + 'px ' + str(random.randint(0, 20)) + 'px ' + str(random.randint(0, 20)) + 'px ' + str(random.randint(0, 20)) + 'px;\r\n'&lt;br /&gt;
string_css += 'margin: ' + str(random.randint(0, 20)) + 'px ' + str(random.randint(0, 20)) + 'px ' + str(random.randint(0, 20)) + 'px ' + str(random.randint(0, 20)) + 'px;\r\n'&lt;br /&gt;
string_css += 'border-width: ' + str(random.randint(0, 20)) + 'px ' + str(random.randint(0, 20)) + 'px ' + str(random.randint(0, 20)) + 'px ' + str(random.randint(0, 20)) + 'px;\r\n'&lt;br /&gt;
string_css += 'border-style: ' + borderTypes[random.randint(0, 4)] + ';\r\n'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Extending the set of elements that can be generated (span, div, header elements, table (and associated table contents), etc.)&lt;br /&gt;
:&lt;br /&gt;
'''Randomly choose whether to generate a document in quirks mode or not&lt;br /&gt;
:Quirks mode is enable whenever an HTML document does not have a DOCTYPE.  To randomly enable Quirks mode we only added a DOCTYPE 50% of the time.&lt;br /&gt;
&lt;br /&gt;
==Testing==&lt;br /&gt;
Because of the nature of this project, testing the newly added features will be very simple. &lt;br /&gt;
: * For task 1, once we are actually controlling Firefox using geckodriver we know its working (by getting a resulting screenshot).  &lt;br /&gt;
: * Task 2 actually involves us comparing screenshots.  By running the code with images that are the same and images that are different, we have proven that this comparison works.   &lt;br /&gt;
: * Additionally, we have visually tested that task 3 is complete (seeing that the new page generation features work).  While we could probably automate some of the testing for task 2 and 3 (to test all possible scenarios) it is out of the scope of this project.&lt;br /&gt;
&lt;br /&gt;
==Conclusion==&lt;br /&gt;
The previously completed work allows us to generate simple html documents with a randomized structure, render the page in Servo, and take a screenshot of the page. This project furthered this work by rendering the pages in both Servo and Firefox, taking screenshots of the pages within both browsers, and reporting differences between the two.  This project also expanded on the random content generator.  This work will now allow users to evaluate Servo’s ability to load web pages. To make this testing even more informative.&lt;/div&gt;</summary>
		<author><name>Adsimps3</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2018-_Project_M1803:_Implement_a_web_page_fuzzer_to_find_rendering_mismatches_(Part_2)&amp;diff=117064</id>
		<title>CSC/ECE 517 Spring 2018- Project M1803: Implement a web page fuzzer to find rendering mismatches (Part 2)</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2018-_Project_M1803:_Implement_a_web_page_fuzzer_to_find_rendering_mismatches_(Part_2)&amp;diff=117064"/>
		<updated>2018-04-27T21:21:48Z</updated>

		<summary type="html">&lt;p&gt;Adsimps3: /* Implementation of Tasks */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;By Alexander Simpson(adsimps3), Abhay Soni (asoni3), Dileep badveli (dbadvel) and Jake Batty(jbatty)&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
This Mozilla project was broken in to 2 main parts: the previous work and the work to be done.  The previous work was finished as a part of the OSS project.  As a part of the OSS project (explained more below) we created a tool which generates random valid HTML files and automated servo.  [https://en.wikipedia.org/wiki/Servo_(layout_engine) Servo] is experimental web browser developed by Mozilla to &amp;quot;to create a new layout engine using a modern programming language&amp;quot;.  By automating servo (the web browser) we were able to quickly see if servo could render the randomly generated pages.  &lt;br /&gt;
&lt;br /&gt;
The goal of this final project was to build off the original project while adding more features.  The work we completed as a part of this project is split into a couple main parts.  First, we extended the program created in the OSS project to also control Firefox.  By also controlling Firefox, we then had 2 screenshots of the randomly generated content - Servo and Firefox .  After getting both screenshots, we then compared them using Python and OpenCV.  Finally, we were able to expand upon the page generation tool to allow the randomly generated web pages to have more properties/be more complex.&lt;br /&gt;
&lt;br /&gt;
==Previous Work (Part of the OSS Project)==&lt;br /&gt;
&lt;br /&gt;
As per the [https://github.com/servo/servo/wiki/Random-web-content-project project description], we were expected to complete the initial steps. The implementation is explained below for each of these steps.&lt;br /&gt;
&lt;br /&gt;
:1) In a new repository, create a program that can generate a skeleton HTML file with a doctype, head element, and body element, print the result to stdout&lt;br /&gt;
::- Here is the [https://github.com/asoni3/Random-web-content-generator---CSC-517-OSS-Project link] to the repository which contains code_generation.py file which will be used to generate random valid HTML files.&lt;br /&gt;
:2) Add a module to the program that enable generating random content specific to the &amp;lt;head&amp;gt; element (such as inline CSS content inside of a &amp;lt;style&amp;gt; element) and add it to the generated output&lt;br /&gt;
::- The file [https://github.com/asoni3/Random-web-content-generator---CSC-517-OSS-Project/blob/master/code_generation.py code_generation.py], contains the code which generates random content specific to the head element and adds style on top of it. As seen in this code, after generating random content to the file, we will add CSS elements on top of this content. We have established a list of commonly used styles, weights, fonts, font_styles, and alignments which will be used at random. For practical purposes, we are limiting the number of options.&lt;br /&gt;
:3) Add a module to the program that enables generating random content specific to the &amp;lt;body&amp;gt; element (such as a &amp;lt;p&amp;gt; block that contains randomly generated text) and add it to the generated output&lt;br /&gt;
:4) Generate simple random CSS that affects randomly generated content (ie. if there is an element with an id foo, generate a CSS selector like #foo that applies a style like colorto it)&lt;br /&gt;
:5) Create a program under Servo's etc/ that launches Servo and causes it to [https://github.com/servo/servo/wiki/Control-Servo-using-WebDriver take a screenshot] of a particular URL - use this to take screenshots of pages randomly generated by the previous program&lt;br /&gt;
:Sample Screenshot:&lt;br /&gt;
:[[File:Servoscreenshot.png|border]]&lt;br /&gt;
&lt;br /&gt;
==Lists of Tasks==&lt;br /&gt;
Below is a list of the tasks that were completed as a part of our final project.  Below each task we have described how exactly it was implemented with code examples.   &lt;br /&gt;
 &lt;br /&gt;
===1) Extend the program that controls Servo to also control Firefox using geckodriver===&lt;br /&gt;
Task 1 is relatively simple.  It just involves downloading geckodriver and running it.  Geckodriver is an open source software engine that allows us to render marked content on a web browser.  It should allow us to take screenshots of a particular URL, just like task 5 in the previous work section, but for Firefox instead.  &lt;br /&gt;
&lt;br /&gt;
===2) Compare the resulting screenshots and report the contents of the generated page if the screenshots differ===&lt;br /&gt;
This task involves automating Firefox to use geckodriver and the current servo program.  They both will create 2 different screenshots.  If servo and Firefox render it differently, we will report that file and mark the differences.  &lt;br /&gt;
&lt;br /&gt;
===3) Extend the page generation tool with a bunch of additional strategies, such as:===&lt;br /&gt;
:-Generating elements trees of arbitrary depth&lt;br /&gt;
:-Generating sibling elements&lt;br /&gt;
:-Extending the set of CSS properties that can be generated (display, background, float, padding, margin, border, etc.)&lt;br /&gt;
:-Extending the set of elements that can be generated (span, div, header elements, table (and associated table contents), etc.)&lt;br /&gt;
:-Randomly choose whether to generate a document in quirks mode or not&lt;br /&gt;
&lt;br /&gt;
:'''UML Diagram of Tasks:'''&lt;br /&gt;
Below is a UML diagram of the tasks of the overall system.  As you can see, it covers all 3 tasks.  It starts with the code generation and then it splits and takes screenshots on both Firefox and Servo.  It then compares then screenshots and reports the distance.&lt;br /&gt;
:[[File:UMLDiag.jpg|border|]]&lt;br /&gt;
&lt;br /&gt;
==Implementation of Tasks==&lt;br /&gt;
:'''1) Extend the program that controls Servo to also control Firefox using geckodriver'''&lt;br /&gt;
&lt;br /&gt;
:'''2) Compare the resulting screenshots and report the contents of the generated page if the screenshots differ'''&lt;br /&gt;
:To actually make the comparisons we use [https://opencv.org/ OpenCV].  OpenCV allows us to not only make comparisons but will also mark where the differences in.  To actually do the comparisons we will first read in the images, convert the images to grayscale, and then call compare_ssim().  &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
imageA = cv2.imread(image1)&lt;br /&gt;
imageB = cv2.imread(image2)&lt;br /&gt;
grayA = cv2.cvtColor(imageA, cv2.COLOR_BGR2GRAY)&lt;br /&gt;
grayB = cv2.cvtColor(imageB, cv2.COLOR_BGR2GRAY)&lt;br /&gt;
(score, diff) = compare_ssim(grayA, grayB, full=True)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This gets us a ''score'' and diff ''values''.  The ''score'' variables represents how close the to images are to each other and the ''diff'' variables tells us where the differences are.  If the ''score'' indicates that the images are different we then use the ''diff'' value to findContours() and then draw a rectangle around the differences.  &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
thresh = cv2.threshold(diff, 0, 255, cv2.THRESH_BINARY_INV | cv2.THRESH_OTSU)[1]&lt;br /&gt;
contours = cv2.findContours(thresh.copy(), cv2.RETR_EXTERNAL, cv2.CHAIN_APPROX_SIMPLE)&lt;br /&gt;
contours = contours[0] if imutils.is_cv2() else contours[1]&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After getting contours, we get a rectangle for each contour by calling &amp;quot;(x, y, w, h) = cv2.boundingRect(c)&amp;quot;.  We then combine any rectangles that are inside each other or very close to each other.  After combining the rectangles, we then add the rectangles to each image.  Lastly we then save image A (with the rectangles to show the differences)&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
for rrr in rectangles:&lt;br /&gt;
    x = rrr[0]&lt;br /&gt;
    y = rrr[1]&lt;br /&gt;
    w = rrr[2]&lt;br /&gt;
    h = rrr[3]             &lt;br /&gt;
    cv2.rectangle(imageA, (x, y), (x + w, y + h), (0, 0, 255), 2)&lt;br /&gt;
    cv2.rectangle(imageB, (x, y), (x + w, y + h), (0, 0, 255), 2)&lt;br /&gt;
cv2.imwrite(filename,imageA)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
:'''3) Extend the page generation tool with a bunch of additional strategies, such as:'''&lt;br /&gt;
:For task 3 there are several different parts, but the main goal was to increase the complexity of our randomly generated pages. The code_generation.py file was adapted to provide these functions.  The implementation of each subtask is explained below.  &lt;br /&gt;
&lt;br /&gt;
'''Generating elements trees of arbitrary depth&lt;br /&gt;
:this&lt;br /&gt;
&lt;br /&gt;
'''Generating sibling elements&lt;br /&gt;
:&lt;br /&gt;
'''Extending the set of CSS properties that can be generated (display, background, float, padding, margin, border, etc.)&lt;br /&gt;
:Implementing this was relatively simple.  We just did the same thing we did before but with more CSS properties.  Below is the code we used to do this.  It does not include creating the arrays with different property values but shows us accessing the different arrays.  &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
string_css += 'display: ' + displayTypes[random.randint(0, 3)] + ';\r\n'&lt;br /&gt;
string_css += 'background-color: rgb(' + str(random.randint(0, 255)) + ',' + str(random.randint(0, 255)) + ',' + str(random.randint(0, 255)) +');\r\n'&lt;br /&gt;
string_css += 'float: ' + floatTypes[random.randint(0, 3)] + ';\r\n'&lt;br /&gt;
string_css += 'padding: ' + str(random.randint(0, 20)) + 'px ' + str(random.randint(0, 20)) + 'px ' + str(random.randint(0, 20)) + 'px ' + str(random.randint(0, 20)) + 'px;\r\n'&lt;br /&gt;
string_css += 'margin: ' + str(random.randint(0, 20)) + 'px ' + str(random.randint(0, 20)) + 'px ' + str(random.randint(0, 20)) + 'px ' + str(random.randint(0, 20)) + 'px;\r\n'&lt;br /&gt;
string_css += 'border-width: ' + str(random.randint(0, 20)) + 'px ' + str(random.randint(0, 20)) + 'px ' + str(random.randint(0, 20)) + 'px ' + str(random.randint(0, 20)) + 'px;\r\n'&lt;br /&gt;
string_css += 'border-style: ' + borderTypes[random.randint(0, 4)] + ';\r\n'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Extending the set of elements that can be generated (span, div, header elements, table (and associated table contents), etc.)&lt;br /&gt;
:&lt;br /&gt;
'''Randomly choose whether to generate a document in quirks mode or not&lt;br /&gt;
:&lt;br /&gt;
&lt;br /&gt;
==Testing==&lt;br /&gt;
Because of the nature of this project, testing the newly added features will be very simple. &lt;br /&gt;
: * For task 1, once we are actually controlling Firefox using geckodriver we know its working (by getting a resulting screenshot).  &lt;br /&gt;
: * Task 2 actually involves us comparing screenshots.  By running the code with images that are the same and images that are different, we have proven that this comparison works.   &lt;br /&gt;
: * Additionally, we have visually tested that task 3 is complete (seeing that the new page generation features work).  While we could probably automate some of the testing for task 2 and 3 (to test all possible scenarios) it is out of the scope of this project.&lt;br /&gt;
&lt;br /&gt;
==Conclusion==&lt;br /&gt;
The previously completed work allows us to generate simple html documents with a randomized structure, render the page in Servo, and take a screenshot of the page. This project furthered this work by rendering the pages in both Servo and Firefox, taking screenshots of the pages within both browsers, and reporting differences between the two.  This project also expanded on the random content generator.  This work will now allow users to evaluate Servo’s ability to load web pages. To make this testing even more informative.&lt;/div&gt;</summary>
		<author><name>Adsimps3</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2018-_Project_M1803:_Implement_a_web_page_fuzzer_to_find_rendering_mismatches_(Part_2)&amp;diff=117062</id>
		<title>CSC/ECE 517 Spring 2018- Project M1803: Implement a web page fuzzer to find rendering mismatches (Part 2)</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2018-_Project_M1803:_Implement_a_web_page_fuzzer_to_find_rendering_mismatches_(Part_2)&amp;diff=117062"/>
		<updated>2018-04-27T21:12:04Z</updated>

		<summary type="html">&lt;p&gt;Adsimps3: /* 3) Extend the page generation tool with a bunch of additional strategies, such as: */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;By Alexander Simpson(adsimps3), Abhay Soni (asoni3), Dileep badveli (dbadvel) and Jake Batty(jbatty)&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
This Mozilla project was broken in to 2 main parts: the previous work and the work to be done.  The previous work was finished as a part of the OSS project.  As a part of the OSS project (explained more below) we created a tool which generates random valid HTML files and automated servo.  [https://en.wikipedia.org/wiki/Servo_(layout_engine) Servo] is experimental web browser developed by Mozilla to &amp;quot;to create a new layout engine using a modern programming language&amp;quot;.  By automating servo (the web browser) we were able to quickly see if servo could render the randomly generated pages.  &lt;br /&gt;
&lt;br /&gt;
The goal of this final project was to build off the original project while adding more features.  The work we completed as a part of this project is split into a couple main parts.  First, we extended the program created in the OSS project to also control Firefox.  By also controlling Firefox, we then had 2 screenshots of the randomly generated content - Servo and Firefox .  After getting both screenshots, we then compared them using Python and OpenCV.  Finally, we were able to expand upon the page generation tool to allow the randomly generated web pages to have more properties/be more complex.&lt;br /&gt;
&lt;br /&gt;
==Previous Work (Part of the OSS Project)==&lt;br /&gt;
&lt;br /&gt;
As per the [https://github.com/servo/servo/wiki/Random-web-content-project project description], we were expected to complete the initial steps. The implementation is explained below for each of these steps.&lt;br /&gt;
&lt;br /&gt;
:1) In a new repository, create a program that can generate a skeleton HTML file with a doctype, head element, and body element, print the result to stdout&lt;br /&gt;
::- Here is the [https://github.com/asoni3/Random-web-content-generator---CSC-517-OSS-Project link] to the repository which contains code_generation.py file which will be used to generate random valid HTML files.&lt;br /&gt;
:2) Add a module to the program that enable generating random content specific to the &amp;lt;head&amp;gt; element (such as inline CSS content inside of a &amp;lt;style&amp;gt; element) and add it to the generated output&lt;br /&gt;
::- The file [https://github.com/asoni3/Random-web-content-generator---CSC-517-OSS-Project/blob/master/code_generation.py code_generation.py], contains the code which generates random content specific to the head element and adds style on top of it. As seen in this code, after generating random content to the file, we will add CSS elements on top of this content. We have established a list of commonly used styles, weights, fonts, font_styles, and alignments which will be used at random. For practical purposes, we are limiting the number of options.&lt;br /&gt;
:3) Add a module to the program that enables generating random content specific to the &amp;lt;body&amp;gt; element (such as a &amp;lt;p&amp;gt; block that contains randomly generated text) and add it to the generated output&lt;br /&gt;
:4) Generate simple random CSS that affects randomly generated content (ie. if there is an element with an id foo, generate a CSS selector like #foo that applies a style like colorto it)&lt;br /&gt;
:5) Create a program under Servo's etc/ that launches Servo and causes it to [https://github.com/servo/servo/wiki/Control-Servo-using-WebDriver take a screenshot] of a particular URL - use this to take screenshots of pages randomly generated by the previous program&lt;br /&gt;
:Sample Screenshot:&lt;br /&gt;
:[[File:Servoscreenshot.png|border]]&lt;br /&gt;
&lt;br /&gt;
==Lists of Tasks==&lt;br /&gt;
Below is a list of the tasks that were completed as a part of our final project.  Below each task we have described how exactly it was implemented with code examples.   &lt;br /&gt;
 &lt;br /&gt;
===1) Extend the program that controls Servo to also control Firefox using geckodriver===&lt;br /&gt;
Task 1 is relatively simple.  It just involves downloading geckodriver and running it.  Geckodriver is an open source software engine that allows us to render marked content on a web browser.  It should allow us to take screenshots of a particular URL, just like task 5 in the previous work section, but for Firefox instead.  &lt;br /&gt;
&lt;br /&gt;
===2) Compare the resulting screenshots and report the contents of the generated page if the screenshots differ===&lt;br /&gt;
This task involves automating Firefox to use geckodriver and the current servo program.  They both will create 2 different screenshots.  If servo and Firefox render it differently, we will report that file and mark the differences.  &lt;br /&gt;
&lt;br /&gt;
===3) Extend the page generation tool with a bunch of additional strategies, such as:===&lt;br /&gt;
:-Generating elements trees of arbitrary depth&lt;br /&gt;
:-Generating sibling elements&lt;br /&gt;
:-Extending the set of CSS properties that can be generated (display, background, float, padding, margin, border, etc.)&lt;br /&gt;
:-Extending the set of elements that can be generated (span, div, header elements, table (and associated table contents), etc.)&lt;br /&gt;
:-Randomly choose whether to generate a document in quirks mode or not&lt;br /&gt;
&lt;br /&gt;
:'''UML Diagram of Tasks:'''&lt;br /&gt;
Below is a UML diagram of the tasks of the overall system.  As you can see, it covers all 3 tasks.  It starts with the code generation and then it splits and takes screenshots on both Firefox and Servo.  It then compares then screenshots and reports the distance.&lt;br /&gt;
:[[File:UMLDiag.jpg|border|]]&lt;br /&gt;
&lt;br /&gt;
==Implementation of Tasks==&lt;br /&gt;
:'''1) Extend the program that controls Servo to also control Firefox using geckodriver'''&lt;br /&gt;
&lt;br /&gt;
:'''2) Compare the resulting screenshots and report the contents of the generated page if the screenshots differ'''&lt;br /&gt;
:To actually make the comparisons we use [https://opencv.org/ OpenCV].  OpenCV allows us to not only make comparisons but will also mark where the differences in.  To actually do the comparisons we will first read in the images, convert the images to grayscale, and then call compare_ssim().  &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
imageA = cv2.imread(image1)&lt;br /&gt;
imageB = cv2.imread(image2)&lt;br /&gt;
grayA = cv2.cvtColor(imageA, cv2.COLOR_BGR2GRAY)&lt;br /&gt;
grayB = cv2.cvtColor(imageB, cv2.COLOR_BGR2GRAY)&lt;br /&gt;
(score, diff) = compare_ssim(grayA, grayB, full=True)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This gets us a ''score'' and diff ''values''.  The ''score'' variables represents how close the to images are to each other and the ''diff'' variables tells us where the differences are.  If the ''score'' indicates that the images are different we then use the ''diff'' value to findContours() and then draw a rectangle around the differences.  &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
thresh = cv2.threshold(diff, 0, 255, cv2.THRESH_BINARY_INV | cv2.THRESH_OTSU)[1]&lt;br /&gt;
contours = cv2.findContours(thresh.copy(), cv2.RETR_EXTERNAL, cv2.CHAIN_APPROX_SIMPLE)&lt;br /&gt;
contours = contours[0] if imutils.is_cv2() else contours[1]&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After getting contours, we get a rectangle for each contour by calling &amp;quot;(x, y, w, h) = cv2.boundingRect(c)&amp;quot;.  We then combine any rectangles that are inside each other or very close to each other.  After combining the rectangles, we then add the rectangles to each image.  Lastly we then save image A (with the rectangles to show the differences)&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
for rrr in rectangles:&lt;br /&gt;
    x = rrr[0]&lt;br /&gt;
    y = rrr[1]&lt;br /&gt;
    w = rrr[2]&lt;br /&gt;
    h = rrr[3]             &lt;br /&gt;
    cv2.rectangle(imageA, (x, y), (x + w, y + h), (0, 0, 255), 2)&lt;br /&gt;
    cv2.rectangle(imageB, (x, y), (x + w, y + h), (0, 0, 255), 2)&lt;br /&gt;
cv2.imwrite(filename,imageA)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
:'''3) Extend the page generation tool with a bunch of additional strategies, such as:'''&lt;br /&gt;
:For task 3 there are several different parts, but the main goal was to increase the complexity of our randomly generated pages. The code_generation.py file was adapted to provide these functions. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Testing==&lt;br /&gt;
Because of the nature of this project, testing the newly added features will be very simple. &lt;br /&gt;
: * For task 1, once we are actually controlling Firefox using geckodriver we know its working (by getting a resulting screenshot).  &lt;br /&gt;
: * Task 2 actually involves us comparing screenshots.  By running the code with images that are the same and images that are different, we have proven that this comparison works.   &lt;br /&gt;
: * Additionally, we have visually tested that task 3 is complete (seeing that the new page generation features work).  While we could probably automate some of the testing for task 2 and 3 (to test all possible scenarios) it is out of the scope of this project.&lt;br /&gt;
&lt;br /&gt;
==Conclusion==&lt;br /&gt;
The previously completed work allows us to generate simple html documents with a randomized structure, render the page in Servo, and take a screenshot of the page. This project furthered this work by rendering the pages in both Servo and Firefox, taking screenshots of the pages within both browsers, and reporting differences between the two.  This project also expanded on the random content generator.  This work will now allow users to evaluate Servo’s ability to load web pages. To make this testing even more informative.&lt;/div&gt;</summary>
		<author><name>Adsimps3</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2018-_Project_M1803:_Implement_a_web_page_fuzzer_to_find_rendering_mismatches_(Part_2)&amp;diff=117061</id>
		<title>CSC/ECE 517 Spring 2018- Project M1803: Implement a web page fuzzer to find rendering mismatches (Part 2)</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2018-_Project_M1803:_Implement_a_web_page_fuzzer_to_find_rendering_mismatches_(Part_2)&amp;diff=117061"/>
		<updated>2018-04-27T21:11:47Z</updated>

		<summary type="html">&lt;p&gt;Adsimps3: /* Lists of Tasks */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;By Alexander Simpson(adsimps3), Abhay Soni (asoni3), Dileep badveli (dbadvel) and Jake Batty(jbatty)&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
This Mozilla project was broken in to 2 main parts: the previous work and the work to be done.  The previous work was finished as a part of the OSS project.  As a part of the OSS project (explained more below) we created a tool which generates random valid HTML files and automated servo.  [https://en.wikipedia.org/wiki/Servo_(layout_engine) Servo] is experimental web browser developed by Mozilla to &amp;quot;to create a new layout engine using a modern programming language&amp;quot;.  By automating servo (the web browser) we were able to quickly see if servo could render the randomly generated pages.  &lt;br /&gt;
&lt;br /&gt;
The goal of this final project was to build off the original project while adding more features.  The work we completed as a part of this project is split into a couple main parts.  First, we extended the program created in the OSS project to also control Firefox.  By also controlling Firefox, we then had 2 screenshots of the randomly generated content - Servo and Firefox .  After getting both screenshots, we then compared them using Python and OpenCV.  Finally, we were able to expand upon the page generation tool to allow the randomly generated web pages to have more properties/be more complex.&lt;br /&gt;
&lt;br /&gt;
==Previous Work (Part of the OSS Project)==&lt;br /&gt;
&lt;br /&gt;
As per the [https://github.com/servo/servo/wiki/Random-web-content-project project description], we were expected to complete the initial steps. The implementation is explained below for each of these steps.&lt;br /&gt;
&lt;br /&gt;
:1) In a new repository, create a program that can generate a skeleton HTML file with a doctype, head element, and body element, print the result to stdout&lt;br /&gt;
::- Here is the [https://github.com/asoni3/Random-web-content-generator---CSC-517-OSS-Project link] to the repository which contains code_generation.py file which will be used to generate random valid HTML files.&lt;br /&gt;
:2) Add a module to the program that enable generating random content specific to the &amp;lt;head&amp;gt; element (such as inline CSS content inside of a &amp;lt;style&amp;gt; element) and add it to the generated output&lt;br /&gt;
::- The file [https://github.com/asoni3/Random-web-content-generator---CSC-517-OSS-Project/blob/master/code_generation.py code_generation.py], contains the code which generates random content specific to the head element and adds style on top of it. As seen in this code, after generating random content to the file, we will add CSS elements on top of this content. We have established a list of commonly used styles, weights, fonts, font_styles, and alignments which will be used at random. For practical purposes, we are limiting the number of options.&lt;br /&gt;
:3) Add a module to the program that enables generating random content specific to the &amp;lt;body&amp;gt; element (such as a &amp;lt;p&amp;gt; block that contains randomly generated text) and add it to the generated output&lt;br /&gt;
:4) Generate simple random CSS that affects randomly generated content (ie. if there is an element with an id foo, generate a CSS selector like #foo that applies a style like colorto it)&lt;br /&gt;
:5) Create a program under Servo's etc/ that launches Servo and causes it to [https://github.com/servo/servo/wiki/Control-Servo-using-WebDriver take a screenshot] of a particular URL - use this to take screenshots of pages randomly generated by the previous program&lt;br /&gt;
:Sample Screenshot:&lt;br /&gt;
:[[File:Servoscreenshot.png|border]]&lt;br /&gt;
&lt;br /&gt;
==Lists of Tasks==&lt;br /&gt;
Below is a list of the tasks that were completed as a part of our final project.  Below each task we have described how exactly it was implemented with code examples.   &lt;br /&gt;
 &lt;br /&gt;
===1) Extend the program that controls Servo to also control Firefox using geckodriver===&lt;br /&gt;
Task 1 is relatively simple.  It just involves downloading geckodriver and running it.  Geckodriver is an open source software engine that allows us to render marked content on a web browser.  It should allow us to take screenshots of a particular URL, just like task 5 in the previous work section, but for Firefox instead.  &lt;br /&gt;
&lt;br /&gt;
===2) Compare the resulting screenshots and report the contents of the generated page if the screenshots differ===&lt;br /&gt;
This task involves automating Firefox to use geckodriver and the current servo program.  They both will create 2 different screenshots.  If servo and Firefox render it differently, we will report that file and mark the differences.  &lt;br /&gt;
&lt;br /&gt;
===3) Extend the page generation tool with a bunch of additional strategies, such as:===&lt;br /&gt;
-Generating elements trees of arbitrary depth&lt;br /&gt;
-Generating sibling elements&lt;br /&gt;
-Extending the set of CSS properties that can be generated (display, background, float, padding, margin, border, etc.)&lt;br /&gt;
-Extending the set of elements that can be generated (span, div, header elements, table (and associated table contents), etc.)&lt;br /&gt;
-Randomly choose whether to generate a document in quirks mode or not&lt;br /&gt;
&lt;br /&gt;
:'''UML Diagram of Tasks:'''&lt;br /&gt;
Below is a UML diagram of the tasks of the overall system.  As you can see, it covers all 3 tasks.  It starts with the code generation and then it splits and takes screenshots on both Firefox and Servo.  It then compares then screenshots and reports the distance.&lt;br /&gt;
:[[File:UMLDiag.jpg|border|]]&lt;br /&gt;
&lt;br /&gt;
==Implementation of Tasks==&lt;br /&gt;
:'''1) Extend the program that controls Servo to also control Firefox using geckodriver'''&lt;br /&gt;
&lt;br /&gt;
:'''2) Compare the resulting screenshots and report the contents of the generated page if the screenshots differ'''&lt;br /&gt;
:To actually make the comparisons we use [https://opencv.org/ OpenCV].  OpenCV allows us to not only make comparisons but will also mark where the differences in.  To actually do the comparisons we will first read in the images, convert the images to grayscale, and then call compare_ssim().  &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
imageA = cv2.imread(image1)&lt;br /&gt;
imageB = cv2.imread(image2)&lt;br /&gt;
grayA = cv2.cvtColor(imageA, cv2.COLOR_BGR2GRAY)&lt;br /&gt;
grayB = cv2.cvtColor(imageB, cv2.COLOR_BGR2GRAY)&lt;br /&gt;
(score, diff) = compare_ssim(grayA, grayB, full=True)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This gets us a ''score'' and diff ''values''.  The ''score'' variables represents how close the to images are to each other and the ''diff'' variables tells us where the differences are.  If the ''score'' indicates that the images are different we then use the ''diff'' value to findContours() and then draw a rectangle around the differences.  &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
thresh = cv2.threshold(diff, 0, 255, cv2.THRESH_BINARY_INV | cv2.THRESH_OTSU)[1]&lt;br /&gt;
contours = cv2.findContours(thresh.copy(), cv2.RETR_EXTERNAL, cv2.CHAIN_APPROX_SIMPLE)&lt;br /&gt;
contours = contours[0] if imutils.is_cv2() else contours[1]&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After getting contours, we get a rectangle for each contour by calling &amp;quot;(x, y, w, h) = cv2.boundingRect(c)&amp;quot;.  We then combine any rectangles that are inside each other or very close to each other.  After combining the rectangles, we then add the rectangles to each image.  Lastly we then save image A (with the rectangles to show the differences)&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
for rrr in rectangles:&lt;br /&gt;
    x = rrr[0]&lt;br /&gt;
    y = rrr[1]&lt;br /&gt;
    w = rrr[2]&lt;br /&gt;
    h = rrr[3]             &lt;br /&gt;
    cv2.rectangle(imageA, (x, y), (x + w, y + h), (0, 0, 255), 2)&lt;br /&gt;
    cv2.rectangle(imageB, (x, y), (x + w, y + h), (0, 0, 255), 2)&lt;br /&gt;
cv2.imwrite(filename,imageA)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
:'''3) Extend the page generation tool with a bunch of additional strategies, such as:'''&lt;br /&gt;
:For task 3 there are several different parts, but the main goal was to increase the complexity of our randomly generated pages. The code_generation.py file was adapted to provide these functions. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Testing==&lt;br /&gt;
Because of the nature of this project, testing the newly added features will be very simple. &lt;br /&gt;
: * For task 1, once we are actually controlling Firefox using geckodriver we know its working (by getting a resulting screenshot).  &lt;br /&gt;
: * Task 2 actually involves us comparing screenshots.  By running the code with images that are the same and images that are different, we have proven that this comparison works.   &lt;br /&gt;
: * Additionally, we have visually tested that task 3 is complete (seeing that the new page generation features work).  While we could probably automate some of the testing for task 2 and 3 (to test all possible scenarios) it is out of the scope of this project.&lt;br /&gt;
&lt;br /&gt;
==Conclusion==&lt;br /&gt;
The previously completed work allows us to generate simple html documents with a randomized structure, render the page in Servo, and take a screenshot of the page. This project furthered this work by rendering the pages in both Servo and Firefox, taking screenshots of the pages within both browsers, and reporting differences between the two.  This project also expanded on the random content generator.  This work will now allow users to evaluate Servo’s ability to load web pages. To make this testing even more informative.&lt;/div&gt;</summary>
		<author><name>Adsimps3</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2018-_Project_M1803:_Implement_a_web_page_fuzzer_to_find_rendering_mismatches_(Part_2)&amp;diff=117060</id>
		<title>CSC/ECE 517 Spring 2018- Project M1803: Implement a web page fuzzer to find rendering mismatches (Part 2)</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2018-_Project_M1803:_Implement_a_web_page_fuzzer_to_find_rendering_mismatches_(Part_2)&amp;diff=117060"/>
		<updated>2018-04-27T21:07:18Z</updated>

		<summary type="html">&lt;p&gt;Adsimps3: /* Implementation of Tasks */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;By Alexander Simpson(adsimps3), Abhay Soni (asoni3), Dileep badveli (dbadvel) and Jake Batty(jbatty)&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
This Mozilla project was broken in to 2 main parts: the previous work and the work to be done.  The previous work was finished as a part of the OSS project.  As a part of the OSS project (explained more below) we created a tool which generates random valid HTML files and automated servo.  [https://en.wikipedia.org/wiki/Servo_(layout_engine) Servo] is experimental web browser developed by Mozilla to &amp;quot;to create a new layout engine using a modern programming language&amp;quot;.  By automating servo (the web browser) we were able to quickly see if servo could render the randomly generated pages.  &lt;br /&gt;
&lt;br /&gt;
The goal of this final project was to build off the original project while adding more features.  The work we completed as a part of this project is split into a couple main parts.  First, we extended the program created in the OSS project to also control Firefox.  By also controlling Firefox, we then had 2 screenshots of the randomly generated content - Servo and Firefox .  After getting both screenshots, we then compared them using Python and OpenCV.  Finally, we were able to expand upon the page generation tool to allow the randomly generated web pages to have more properties/be more complex.&lt;br /&gt;
&lt;br /&gt;
==Previous Work (Part of the OSS Project)==&lt;br /&gt;
&lt;br /&gt;
As per the [https://github.com/servo/servo/wiki/Random-web-content-project project description], we were expected to complete the initial steps. The implementation is explained below for each of these steps.&lt;br /&gt;
&lt;br /&gt;
:1) In a new repository, create a program that can generate a skeleton HTML file with a doctype, head element, and body element, print the result to stdout&lt;br /&gt;
::- Here is the [https://github.com/asoni3/Random-web-content-generator---CSC-517-OSS-Project link] to the repository which contains code_generation.py file which will be used to generate random valid HTML files.&lt;br /&gt;
:2) Add a module to the program that enable generating random content specific to the &amp;lt;head&amp;gt; element (such as inline CSS content inside of a &amp;lt;style&amp;gt; element) and add it to the generated output&lt;br /&gt;
::- The file [https://github.com/asoni3/Random-web-content-generator---CSC-517-OSS-Project/blob/master/code_generation.py code_generation.py], contains the code which generates random content specific to the head element and adds style on top of it. As seen in this code, after generating random content to the file, we will add CSS elements on top of this content. We have established a list of commonly used styles, weights, fonts, font_styles, and alignments which will be used at random. For practical purposes, we are limiting the number of options.&lt;br /&gt;
:3) Add a module to the program that enables generating random content specific to the &amp;lt;body&amp;gt; element (such as a &amp;lt;p&amp;gt; block that contains randomly generated text) and add it to the generated output&lt;br /&gt;
:4) Generate simple random CSS that affects randomly generated content (ie. if there is an element with an id foo, generate a CSS selector like #foo that applies a style like colorto it)&lt;br /&gt;
:5) Create a program under Servo's etc/ that launches Servo and causes it to [https://github.com/servo/servo/wiki/Control-Servo-using-WebDriver take a screenshot] of a particular URL - use this to take screenshots of pages randomly generated by the previous program&lt;br /&gt;
:Sample Screenshot:&lt;br /&gt;
:[[File:Servoscreenshot.png|border]]&lt;br /&gt;
&lt;br /&gt;
==Lists of Tasks==&lt;br /&gt;
Below is a list of the tasks that were completed as a part of our final project.  Below each task we have described how exactly it was implemented with code examples.   &lt;br /&gt;
 &lt;br /&gt;
===1) Extend the program that controls Servo to also control Firefox using geckodriver===&lt;br /&gt;
Task 1 is relatively simple.  It just involves downloading geckodriver and running it.  Geckodriver is an open source software engine that allows us to render marked content on a web browser.  It should allow us to take screenshots of a particular URL, just like task 5 in the previous work section, but for Firefox instead.  &lt;br /&gt;
&lt;br /&gt;
===2) Compare the resulting screenshots and report the contents of the generated page if the screenshots differ===&lt;br /&gt;
This task involves automating Firefox to use geckodriver and the current servo program.  They both will create 2 different screenshots.  If servo and Firefox render it differently, we will report that file and mark the differences.  &lt;br /&gt;
&lt;br /&gt;
===3) Extend the page generation tool with a bunch of additional strategies, such as:===&lt;br /&gt;
====Generating elements trees of arbitrary depth====&lt;br /&gt;
====Generating sibling elements====&lt;br /&gt;
====Extending the set of CSS properties that can be generated (display, background, float, padding, margin, border, etc.)====&lt;br /&gt;
====Extending the set of elements that can be generated (span, div, header elements, table (and associated table contents), etc.)====&lt;br /&gt;
====Randomly choose whether to generate a document in quirks mode or not====&lt;br /&gt;
&lt;br /&gt;
:'''UML Diagram of Tasks:'''&lt;br /&gt;
Below is a UML diagram of the tasks of the overall system.  As you can see, it covers all 3 tasks.  It starts with the code generation and then it splits and takes screenshots on both Firefox and Servo.  It then compares then screenshots and reports the distance.&lt;br /&gt;
:[[File:UMLDiag.jpg|border|]]&lt;br /&gt;
&lt;br /&gt;
==Implementation of Tasks==&lt;br /&gt;
:'''1) Extend the program that controls Servo to also control Firefox using geckodriver'''&lt;br /&gt;
&lt;br /&gt;
:'''2) Compare the resulting screenshots and report the contents of the generated page if the screenshots differ'''&lt;br /&gt;
:To actually make the comparisons we use [https://opencv.org/ OpenCV].  OpenCV allows us to not only make comparisons but will also mark where the differences in.  To actually do the comparisons we will first read in the images, convert the images to grayscale, and then call compare_ssim().  &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
imageA = cv2.imread(image1)&lt;br /&gt;
imageB = cv2.imread(image2)&lt;br /&gt;
grayA = cv2.cvtColor(imageA, cv2.COLOR_BGR2GRAY)&lt;br /&gt;
grayB = cv2.cvtColor(imageB, cv2.COLOR_BGR2GRAY)&lt;br /&gt;
(score, diff) = compare_ssim(grayA, grayB, full=True)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This gets us a ''score'' and diff ''values''.  The ''score'' variables represents how close the to images are to each other and the ''diff'' variables tells us where the differences are.  If the ''score'' indicates that the images are different we then use the ''diff'' value to findContours() and then draw a rectangle around the differences.  &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
thresh = cv2.threshold(diff, 0, 255, cv2.THRESH_BINARY_INV | cv2.THRESH_OTSU)[1]&lt;br /&gt;
contours = cv2.findContours(thresh.copy(), cv2.RETR_EXTERNAL, cv2.CHAIN_APPROX_SIMPLE)&lt;br /&gt;
contours = contours[0] if imutils.is_cv2() else contours[1]&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After getting contours, we get a rectangle for each contour by calling &amp;quot;(x, y, w, h) = cv2.boundingRect(c)&amp;quot;.  We then combine any rectangles that are inside each other or very close to each other.  After combining the rectangles, we then add the rectangles to each image.  Lastly we then save image A (with the rectangles to show the differences)&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
for rrr in rectangles:&lt;br /&gt;
    x = rrr[0]&lt;br /&gt;
    y = rrr[1]&lt;br /&gt;
    w = rrr[2]&lt;br /&gt;
    h = rrr[3]             &lt;br /&gt;
    cv2.rectangle(imageA, (x, y), (x + w, y + h), (0, 0, 255), 2)&lt;br /&gt;
    cv2.rectangle(imageB, (x, y), (x + w, y + h), (0, 0, 255), 2)&lt;br /&gt;
cv2.imwrite(filename,imageA)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
:'''3) Extend the page generation tool with a bunch of additional strategies, such as:'''&lt;br /&gt;
:For task 3 there are several different parts, but the main goal was to increase the complexity of our randomly generated pages. The code_generation.py file was adapted to provide these functions. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Testing==&lt;br /&gt;
Because of the nature of this project, testing the newly added features will be very simple. &lt;br /&gt;
: * For task 1, once we are actually controlling Firefox using geckodriver we know its working (by getting a resulting screenshot).  &lt;br /&gt;
: * Task 2 actually involves us comparing screenshots.  By running the code with images that are the same and images that are different, we have proven that this comparison works.   &lt;br /&gt;
: * Additionally, we have visually tested that task 3 is complete (seeing that the new page generation features work).  While we could probably automate some of the testing for task 2 and 3 (to test all possible scenarios) it is out of the scope of this project.&lt;br /&gt;
&lt;br /&gt;
==Conclusion==&lt;br /&gt;
The previously completed work allows us to generate simple html documents with a randomized structure, render the page in Servo, and take a screenshot of the page. This project furthered this work by rendering the pages in both Servo and Firefox, taking screenshots of the pages within both browsers, and reporting differences between the two.  This project also expanded on the random content generator.  This work will now allow users to evaluate Servo’s ability to load web pages. To make this testing even more informative.&lt;/div&gt;</summary>
		<author><name>Adsimps3</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2018-_Project_M1803:_Implement_a_web_page_fuzzer_to_find_rendering_mismatches_(Part_2)&amp;diff=117059</id>
		<title>CSC/ECE 517 Spring 2018- Project M1803: Implement a web page fuzzer to find rendering mismatches (Part 2)</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2018-_Project_M1803:_Implement_a_web_page_fuzzer_to_find_rendering_mismatches_(Part_2)&amp;diff=117059"/>
		<updated>2018-04-27T21:04:33Z</updated>

		<summary type="html">&lt;p&gt;Adsimps3: /* Conclusion */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;By Alexander Simpson(adsimps3), Abhay Soni (asoni3), Dileep badveli (dbadvel) and Jake Batty(jbatty)&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
This Mozilla project was broken in to 2 main parts: the previous work and the work to be done.  The previous work was finished as a part of the OSS project.  As a part of the OSS project (explained more below) we created a tool which generates random valid HTML files and automated servo.  [https://en.wikipedia.org/wiki/Servo_(layout_engine) Servo] is experimental web browser developed by Mozilla to &amp;quot;to create a new layout engine using a modern programming language&amp;quot;.  By automating servo (the web browser) we were able to quickly see if servo could render the randomly generated pages.  &lt;br /&gt;
&lt;br /&gt;
The goal of this final project was to build off the original project while adding more features.  The work we completed as a part of this project is split into a couple main parts.  First, we extended the program created in the OSS project to also control Firefox.  By also controlling Firefox, we then had 2 screenshots of the randomly generated content - Servo and Firefox .  After getting both screenshots, we then compared them using Python and OpenCV.  Finally, we were able to expand upon the page generation tool to allow the randomly generated web pages to have more properties/be more complex.&lt;br /&gt;
&lt;br /&gt;
==Previous Work (Part of the OSS Project)==&lt;br /&gt;
&lt;br /&gt;
As per the [https://github.com/servo/servo/wiki/Random-web-content-project project description], we were expected to complete the initial steps. The implementation is explained below for each of these steps.&lt;br /&gt;
&lt;br /&gt;
:1) In a new repository, create a program that can generate a skeleton HTML file with a doctype, head element, and body element, print the result to stdout&lt;br /&gt;
::- Here is the [https://github.com/asoni3/Random-web-content-generator---CSC-517-OSS-Project link] to the repository which contains code_generation.py file which will be used to generate random valid HTML files.&lt;br /&gt;
:2) Add a module to the program that enable generating random content specific to the &amp;lt;head&amp;gt; element (such as inline CSS content inside of a &amp;lt;style&amp;gt; element) and add it to the generated output&lt;br /&gt;
::- The file [https://github.com/asoni3/Random-web-content-generator---CSC-517-OSS-Project/blob/master/code_generation.py code_generation.py], contains the code which generates random content specific to the head element and adds style on top of it. As seen in this code, after generating random content to the file, we will add CSS elements on top of this content. We have established a list of commonly used styles, weights, fonts, font_styles, and alignments which will be used at random. For practical purposes, we are limiting the number of options.&lt;br /&gt;
:3) Add a module to the program that enables generating random content specific to the &amp;lt;body&amp;gt; element (such as a &amp;lt;p&amp;gt; block that contains randomly generated text) and add it to the generated output&lt;br /&gt;
:4) Generate simple random CSS that affects randomly generated content (ie. if there is an element with an id foo, generate a CSS selector like #foo that applies a style like colorto it)&lt;br /&gt;
:5) Create a program under Servo's etc/ that launches Servo and causes it to [https://github.com/servo/servo/wiki/Control-Servo-using-WebDriver take a screenshot] of a particular URL - use this to take screenshots of pages randomly generated by the previous program&lt;br /&gt;
:Sample Screenshot:&lt;br /&gt;
:[[File:Servoscreenshot.png|border]]&lt;br /&gt;
&lt;br /&gt;
==Lists of Tasks==&lt;br /&gt;
Below is a list of the tasks that were completed as a part of our final project.  Below each task we have described how exactly it was implemented with code examples.   &lt;br /&gt;
 &lt;br /&gt;
===1) Extend the program that controls Servo to also control Firefox using geckodriver===&lt;br /&gt;
Task 1 is relatively simple.  It just involves downloading geckodriver and running it.  Geckodriver is an open source software engine that allows us to render marked content on a web browser.  It should allow us to take screenshots of a particular URL, just like task 5 in the previous work section, but for Firefox instead.  &lt;br /&gt;
&lt;br /&gt;
===2) Compare the resulting screenshots and report the contents of the generated page if the screenshots differ===&lt;br /&gt;
This task involves automating Firefox to use geckodriver and the current servo program.  They both will create 2 different screenshots.  If servo and Firefox render it differently, we will report that file and mark the differences.  &lt;br /&gt;
&lt;br /&gt;
===3) Extend the page generation tool with a bunch of additional strategies, such as:===&lt;br /&gt;
====Generating elements trees of arbitrary depth====&lt;br /&gt;
====Generating sibling elements====&lt;br /&gt;
====Extending the set of CSS properties that can be generated (display, background, float, padding, margin, border, etc.)====&lt;br /&gt;
====Extending the set of elements that can be generated (span, div, header elements, table (and associated table contents), etc.)====&lt;br /&gt;
====Randomly choose whether to generate a document in quirks mode or not====&lt;br /&gt;
&lt;br /&gt;
:'''UML Diagram of Tasks:'''&lt;br /&gt;
Below is a UML diagram of the tasks of the overall system.  As you can see, it covers all 3 tasks.  It starts with the code generation and then it splits and takes screenshots on both Firefox and Servo.  It then compares then screenshots and reports the distance.&lt;br /&gt;
:[[File:UMLDiag.jpg|border|]]&lt;br /&gt;
&lt;br /&gt;
==Implementation of Tasks==&lt;br /&gt;
:'''1) Extend the program that controls Servo to also control Firefox using geckodriver'''&lt;br /&gt;
&lt;br /&gt;
:'''2) Compare the resulting screenshots and report the contents of the generated page if the screenshots differ'''&lt;br /&gt;
:To actually make the comparisons we use [https://opencv.org/ OpenCV].  OpenCV allows us to not only make comparisons but will also mark where the differences in.  To actually do the comparisons we will first read in the images, convert the images to grayscale, and then call compare_ssim().  &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
imageA = cv2.imread(image1)&lt;br /&gt;
imageB = cv2.imread(image2)&lt;br /&gt;
grayA = cv2.cvtColor(imageA, cv2.COLOR_BGR2GRAY)&lt;br /&gt;
grayB = cv2.cvtColor(imageB, cv2.COLOR_BGR2GRAY)&lt;br /&gt;
(score, diff) = compare_ssim(grayA, grayB, full=True)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This gets us a ''score'' and diff ''values''.  The ''score'' variables represents how close the to images are to each other and the ''diff'' variables tells us where the differences are.  If the ''score'' indicates that the images are different we then use the ''diff'' value to findContours() and then draw a rectangle around the differences.  &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
thresh = cv2.threshold(diff, 0, 255, cv2.THRESH_BINARY_INV | cv2.THRESH_OTSU)[1]&lt;br /&gt;
contours = cv2.findContours(thresh.copy(), cv2.RETR_EXTERNAL, cv2.CHAIN_APPROX_SIMPLE)&lt;br /&gt;
contours = contours[0] if imutils.is_cv2() else contours[1]&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After getting contours, we get a rectangle for each contour by calling &amp;quot;(x, y, w, h) = cv2.boundingRect(c)&amp;quot;.  We then combine any rectangles that are inside each other or very close to each other.  After combining the rectangles, we then add the rectangles to each image.  Lastly we then save image A (with the rectangles to show the differences)&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
for rrr in rectangles:&lt;br /&gt;
    x = rrr[0]&lt;br /&gt;
    y = rrr[1]&lt;br /&gt;
    w = rrr[2]&lt;br /&gt;
    h = rrr[3]             &lt;br /&gt;
    cv2.rectangle(imageA, (x, y), (x + w, y + h), (0, 0, 255), 2)&lt;br /&gt;
    cv2.rectangle(imageB, (x, y), (x + w, y + h), (0, 0, 255), 2)&lt;br /&gt;
cv2.imwrite(filename,imageA)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
:'''3) Extend the page generation tool with a bunch of additional strategies, such as:'''&lt;br /&gt;
:For task 3 there are several different parts, but the main goal is to increase the complexity of our randomly generated pages. The code_generation.py file will be adapted to provide these functions. The function used to add random sections will have recursion added to generate elements within elements, resulting in a tree of html elements. The amounting of nesting will be random but limited. Within the sections, tables, lists, spans, and divs may potentially be created. This will involve writing new functions for creating each element, and allowing them to be chosen at random by the function that creates sections of the HTML document. Additionally, the function which provides randomized CSS styling will be extended to generate additional properties.&lt;br /&gt;
&lt;br /&gt;
==Testing==&lt;br /&gt;
Because of the nature of this project, testing the newly added features will be very simple. &lt;br /&gt;
: * For task 1, once we are actually controlling Firefox using geckodriver we know its working (by getting a resulting screenshot).  &lt;br /&gt;
: * Task 2 actually involves us comparing screenshots.  By running the code with images that are the same and images that are different, we have proven that this comparison works.   &lt;br /&gt;
: * Additionally, we have visually tested that task 3 is complete (seeing that the new page generation features work).  While we could probably automate some of the testing for task 2 and 3 (to test all possible scenarios) it is out of the scope of this project.&lt;br /&gt;
&lt;br /&gt;
==Conclusion==&lt;br /&gt;
The previously completed work allows us to generate simple html documents with a randomized structure, render the page in Servo, and take a screenshot of the page. This project furthered this work by rendering the pages in both Servo and Firefox, taking screenshots of the pages within both browsers, and reporting differences between the two.  This project also expanded on the random content generator.  This work will now allow users to evaluate Servo’s ability to load web pages. To make this testing even more informative.&lt;/div&gt;</summary>
		<author><name>Adsimps3</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2018-_Project_M1803:_Implement_a_web_page_fuzzer_to_find_rendering_mismatches_(Part_2)&amp;diff=117058</id>
		<title>CSC/ECE 517 Spring 2018- Project M1803: Implement a web page fuzzer to find rendering mismatches (Part 2)</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2018-_Project_M1803:_Implement_a_web_page_fuzzer_to_find_rendering_mismatches_(Part_2)&amp;diff=117058"/>
		<updated>2018-04-27T21:02:51Z</updated>

		<summary type="html">&lt;p&gt;Adsimps3: /* Testing */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;By Alexander Simpson(adsimps3), Abhay Soni (asoni3), Dileep badveli (dbadvel) and Jake Batty(jbatty)&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
This Mozilla project was broken in to 2 main parts: the previous work and the work to be done.  The previous work was finished as a part of the OSS project.  As a part of the OSS project (explained more below) we created a tool which generates random valid HTML files and automated servo.  [https://en.wikipedia.org/wiki/Servo_(layout_engine) Servo] is experimental web browser developed by Mozilla to &amp;quot;to create a new layout engine using a modern programming language&amp;quot;.  By automating servo (the web browser) we were able to quickly see if servo could render the randomly generated pages.  &lt;br /&gt;
&lt;br /&gt;
The goal of this final project was to build off the original project while adding more features.  The work we completed as a part of this project is split into a couple main parts.  First, we extended the program created in the OSS project to also control Firefox.  By also controlling Firefox, we then had 2 screenshots of the randomly generated content - Servo and Firefox .  After getting both screenshots, we then compared them using Python and OpenCV.  Finally, we were able to expand upon the page generation tool to allow the randomly generated web pages to have more properties/be more complex.&lt;br /&gt;
&lt;br /&gt;
==Previous Work (Part of the OSS Project)==&lt;br /&gt;
&lt;br /&gt;
As per the [https://github.com/servo/servo/wiki/Random-web-content-project project description], we were expected to complete the initial steps. The implementation is explained below for each of these steps.&lt;br /&gt;
&lt;br /&gt;
:1) In a new repository, create a program that can generate a skeleton HTML file with a doctype, head element, and body element, print the result to stdout&lt;br /&gt;
::- Here is the [https://github.com/asoni3/Random-web-content-generator---CSC-517-OSS-Project link] to the repository which contains code_generation.py file which will be used to generate random valid HTML files.&lt;br /&gt;
:2) Add a module to the program that enable generating random content specific to the &amp;lt;head&amp;gt; element (such as inline CSS content inside of a &amp;lt;style&amp;gt; element) and add it to the generated output&lt;br /&gt;
::- The file [https://github.com/asoni3/Random-web-content-generator---CSC-517-OSS-Project/blob/master/code_generation.py code_generation.py], contains the code which generates random content specific to the head element and adds style on top of it. As seen in this code, after generating random content to the file, we will add CSS elements on top of this content. We have established a list of commonly used styles, weights, fonts, font_styles, and alignments which will be used at random. For practical purposes, we are limiting the number of options.&lt;br /&gt;
:3) Add a module to the program that enables generating random content specific to the &amp;lt;body&amp;gt; element (such as a &amp;lt;p&amp;gt; block that contains randomly generated text) and add it to the generated output&lt;br /&gt;
:4) Generate simple random CSS that affects randomly generated content (ie. if there is an element with an id foo, generate a CSS selector like #foo that applies a style like colorto it)&lt;br /&gt;
:5) Create a program under Servo's etc/ that launches Servo and causes it to [https://github.com/servo/servo/wiki/Control-Servo-using-WebDriver take a screenshot] of a particular URL - use this to take screenshots of pages randomly generated by the previous program&lt;br /&gt;
:Sample Screenshot:&lt;br /&gt;
:[[File:Servoscreenshot.png|border]]&lt;br /&gt;
&lt;br /&gt;
==Lists of Tasks==&lt;br /&gt;
Below is a list of the tasks that were completed as a part of our final project.  Below each task we have described how exactly it was implemented with code examples.   &lt;br /&gt;
 &lt;br /&gt;
===1) Extend the program that controls Servo to also control Firefox using geckodriver===&lt;br /&gt;
Task 1 is relatively simple.  It just involves downloading geckodriver and running it.  Geckodriver is an open source software engine that allows us to render marked content on a web browser.  It should allow us to take screenshots of a particular URL, just like task 5 in the previous work section, but for Firefox instead.  &lt;br /&gt;
&lt;br /&gt;
===2) Compare the resulting screenshots and report the contents of the generated page if the screenshots differ===&lt;br /&gt;
This task involves automating Firefox to use geckodriver and the current servo program.  They both will create 2 different screenshots.  If servo and Firefox render it differently, we will report that file and mark the differences.  &lt;br /&gt;
&lt;br /&gt;
===3) Extend the page generation tool with a bunch of additional strategies, such as:===&lt;br /&gt;
====Generating elements trees of arbitrary depth====&lt;br /&gt;
====Generating sibling elements====&lt;br /&gt;
====Extending the set of CSS properties that can be generated (display, background, float, padding, margin, border, etc.)====&lt;br /&gt;
====Extending the set of elements that can be generated (span, div, header elements, table (and associated table contents), etc.)====&lt;br /&gt;
====Randomly choose whether to generate a document in quirks mode or not====&lt;br /&gt;
&lt;br /&gt;
:'''UML Diagram of Tasks:'''&lt;br /&gt;
Below is a UML diagram of the tasks of the overall system.  As you can see, it covers all 3 tasks.  It starts with the code generation and then it splits and takes screenshots on both Firefox and Servo.  It then compares then screenshots and reports the distance.&lt;br /&gt;
:[[File:UMLDiag.jpg|border|]]&lt;br /&gt;
&lt;br /&gt;
==Implementation of Tasks==&lt;br /&gt;
:'''1) Extend the program that controls Servo to also control Firefox using geckodriver'''&lt;br /&gt;
&lt;br /&gt;
:'''2) Compare the resulting screenshots and report the contents of the generated page if the screenshots differ'''&lt;br /&gt;
:To actually make the comparisons we use [https://opencv.org/ OpenCV].  OpenCV allows us to not only make comparisons but will also mark where the differences in.  To actually do the comparisons we will first read in the images, convert the images to grayscale, and then call compare_ssim().  &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
imageA = cv2.imread(image1)&lt;br /&gt;
imageB = cv2.imread(image2)&lt;br /&gt;
grayA = cv2.cvtColor(imageA, cv2.COLOR_BGR2GRAY)&lt;br /&gt;
grayB = cv2.cvtColor(imageB, cv2.COLOR_BGR2GRAY)&lt;br /&gt;
(score, diff) = compare_ssim(grayA, grayB, full=True)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This gets us a ''score'' and diff ''values''.  The ''score'' variables represents how close the to images are to each other and the ''diff'' variables tells us where the differences are.  If the ''score'' indicates that the images are different we then use the ''diff'' value to findContours() and then draw a rectangle around the differences.  &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
thresh = cv2.threshold(diff, 0, 255, cv2.THRESH_BINARY_INV | cv2.THRESH_OTSU)[1]&lt;br /&gt;
contours = cv2.findContours(thresh.copy(), cv2.RETR_EXTERNAL, cv2.CHAIN_APPROX_SIMPLE)&lt;br /&gt;
contours = contours[0] if imutils.is_cv2() else contours[1]&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After getting contours, we get a rectangle for each contour by calling &amp;quot;(x, y, w, h) = cv2.boundingRect(c)&amp;quot;.  We then combine any rectangles that are inside each other or very close to each other.  After combining the rectangles, we then add the rectangles to each image.  Lastly we then save image A (with the rectangles to show the differences)&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
for rrr in rectangles:&lt;br /&gt;
    x = rrr[0]&lt;br /&gt;
    y = rrr[1]&lt;br /&gt;
    w = rrr[2]&lt;br /&gt;
    h = rrr[3]             &lt;br /&gt;
    cv2.rectangle(imageA, (x, y), (x + w, y + h), (0, 0, 255), 2)&lt;br /&gt;
    cv2.rectangle(imageB, (x, y), (x + w, y + h), (0, 0, 255), 2)&lt;br /&gt;
cv2.imwrite(filename,imageA)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
:'''3) Extend the page generation tool with a bunch of additional strategies, such as:'''&lt;br /&gt;
:For task 3 there are several different parts, but the main goal is to increase the complexity of our randomly generated pages. The code_generation.py file will be adapted to provide these functions. The function used to add random sections will have recursion added to generate elements within elements, resulting in a tree of html elements. The amounting of nesting will be random but limited. Within the sections, tables, lists, spans, and divs may potentially be created. This will involve writing new functions for creating each element, and allowing them to be chosen at random by the function that creates sections of the HTML document. Additionally, the function which provides randomized CSS styling will be extended to generate additional properties.&lt;br /&gt;
&lt;br /&gt;
==Testing==&lt;br /&gt;
Because of the nature of this project, testing the newly added features will be very simple. &lt;br /&gt;
: * For task 1, once we are actually controlling Firefox using geckodriver we know its working (by getting a resulting screenshot).  &lt;br /&gt;
: * Task 2 actually involves us comparing screenshots.  By running the code with images that are the same and images that are different, we have proven that this comparison works.   &lt;br /&gt;
: * Additionally, we have visually tested that task 3 is complete (seeing that the new page generation features work).  While we could probably automate some of the testing for task 2 and 3 (to test all possible scenarios) it is out of the scope of this project.&lt;br /&gt;
&lt;br /&gt;
==Conclusion==&lt;br /&gt;
The previously completed work allows us to generate simple html documents with a randomized structure, render the page in Servo, and take a screenshot of the page. We plan on furthering this work by rendering the pages in both Servo and Firefox, taking screenshots of the pages within both browsers, and reporting differences between the two. Doing so will allow users to evaluate Servo’s ability to load web pages. To make this testing even more informative, we plan to increase the complexity of the structure and styling of the randomly generated html documents.&lt;/div&gt;</summary>
		<author><name>Adsimps3</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2018-_Project_M1803:_Implement_a_web_page_fuzzer_to_find_rendering_mismatches_(Part_2)&amp;diff=117057</id>
		<title>CSC/ECE 517 Spring 2018- Project M1803: Implement a web page fuzzer to find rendering mismatches (Part 2)</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2018-_Project_M1803:_Implement_a_web_page_fuzzer_to_find_rendering_mismatches_(Part_2)&amp;diff=117057"/>
		<updated>2018-04-27T21:01:03Z</updated>

		<summary type="html">&lt;p&gt;Adsimps3: /* Implementation of Tasks */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;By Alexander Simpson(adsimps3), Abhay Soni (asoni3), Dileep badveli (dbadvel) and Jake Batty(jbatty)&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
This Mozilla project was broken in to 2 main parts: the previous work and the work to be done.  The previous work was finished as a part of the OSS project.  As a part of the OSS project (explained more below) we created a tool which generates random valid HTML files and automated servo.  [https://en.wikipedia.org/wiki/Servo_(layout_engine) Servo] is experimental web browser developed by Mozilla to &amp;quot;to create a new layout engine using a modern programming language&amp;quot;.  By automating servo (the web browser) we were able to quickly see if servo could render the randomly generated pages.  &lt;br /&gt;
&lt;br /&gt;
The goal of this final project was to build off the original project while adding more features.  The work we completed as a part of this project is split into a couple main parts.  First, we extended the program created in the OSS project to also control Firefox.  By also controlling Firefox, we then had 2 screenshots of the randomly generated content - Servo and Firefox .  After getting both screenshots, we then compared them using Python and OpenCV.  Finally, we were able to expand upon the page generation tool to allow the randomly generated web pages to have more properties/be more complex.&lt;br /&gt;
&lt;br /&gt;
==Previous Work (Part of the OSS Project)==&lt;br /&gt;
&lt;br /&gt;
As per the [https://github.com/servo/servo/wiki/Random-web-content-project project description], we were expected to complete the initial steps. The implementation is explained below for each of these steps.&lt;br /&gt;
&lt;br /&gt;
:1) In a new repository, create a program that can generate a skeleton HTML file with a doctype, head element, and body element, print the result to stdout&lt;br /&gt;
::- Here is the [https://github.com/asoni3/Random-web-content-generator---CSC-517-OSS-Project link] to the repository which contains code_generation.py file which will be used to generate random valid HTML files.&lt;br /&gt;
:2) Add a module to the program that enable generating random content specific to the &amp;lt;head&amp;gt; element (such as inline CSS content inside of a &amp;lt;style&amp;gt; element) and add it to the generated output&lt;br /&gt;
::- The file [https://github.com/asoni3/Random-web-content-generator---CSC-517-OSS-Project/blob/master/code_generation.py code_generation.py], contains the code which generates random content specific to the head element and adds style on top of it. As seen in this code, after generating random content to the file, we will add CSS elements on top of this content. We have established a list of commonly used styles, weights, fonts, font_styles, and alignments which will be used at random. For practical purposes, we are limiting the number of options.&lt;br /&gt;
:3) Add a module to the program that enables generating random content specific to the &amp;lt;body&amp;gt; element (such as a &amp;lt;p&amp;gt; block that contains randomly generated text) and add it to the generated output&lt;br /&gt;
:4) Generate simple random CSS that affects randomly generated content (ie. if there is an element with an id foo, generate a CSS selector like #foo that applies a style like colorto it)&lt;br /&gt;
:5) Create a program under Servo's etc/ that launches Servo and causes it to [https://github.com/servo/servo/wiki/Control-Servo-using-WebDriver take a screenshot] of a particular URL - use this to take screenshots of pages randomly generated by the previous program&lt;br /&gt;
:Sample Screenshot:&lt;br /&gt;
:[[File:Servoscreenshot.png|border]]&lt;br /&gt;
&lt;br /&gt;
==Lists of Tasks==&lt;br /&gt;
Below is a list of the tasks that were completed as a part of our final project.  Below each task we have described how exactly it was implemented with code examples.   &lt;br /&gt;
 &lt;br /&gt;
===1) Extend the program that controls Servo to also control Firefox using geckodriver===&lt;br /&gt;
Task 1 is relatively simple.  It just involves downloading geckodriver and running it.  Geckodriver is an open source software engine that allows us to render marked content on a web browser.  It should allow us to take screenshots of a particular URL, just like task 5 in the previous work section, but for Firefox instead.  &lt;br /&gt;
&lt;br /&gt;
===2) Compare the resulting screenshots and report the contents of the generated page if the screenshots differ===&lt;br /&gt;
This task involves automating Firefox to use geckodriver and the current servo program.  They both will create 2 different screenshots.  If servo and Firefox render it differently, we will report that file and mark the differences.  &lt;br /&gt;
&lt;br /&gt;
===3) Extend the page generation tool with a bunch of additional strategies, such as:===&lt;br /&gt;
====Generating elements trees of arbitrary depth====&lt;br /&gt;
====Generating sibling elements====&lt;br /&gt;
====Extending the set of CSS properties that can be generated (display, background, float, padding, margin, border, etc.)====&lt;br /&gt;
====Extending the set of elements that can be generated (span, div, header elements, table (and associated table contents), etc.)====&lt;br /&gt;
====Randomly choose whether to generate a document in quirks mode or not====&lt;br /&gt;
&lt;br /&gt;
:'''UML Diagram of Tasks:'''&lt;br /&gt;
Below is a UML diagram of the tasks of the overall system.  As you can see, it covers all 3 tasks.  It starts with the code generation and then it splits and takes screenshots on both Firefox and Servo.  It then compares then screenshots and reports the distance.&lt;br /&gt;
:[[File:UMLDiag.jpg|border|]]&lt;br /&gt;
&lt;br /&gt;
==Implementation of Tasks==&lt;br /&gt;
:'''1) Extend the program that controls Servo to also control Firefox using geckodriver'''&lt;br /&gt;
&lt;br /&gt;
:'''2) Compare the resulting screenshots and report the contents of the generated page if the screenshots differ'''&lt;br /&gt;
:To actually make the comparisons we use [https://opencv.org/ OpenCV].  OpenCV allows us to not only make comparisons but will also mark where the differences in.  To actually do the comparisons we will first read in the images, convert the images to grayscale, and then call compare_ssim().  &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
imageA = cv2.imread(image1)&lt;br /&gt;
imageB = cv2.imread(image2)&lt;br /&gt;
grayA = cv2.cvtColor(imageA, cv2.COLOR_BGR2GRAY)&lt;br /&gt;
grayB = cv2.cvtColor(imageB, cv2.COLOR_BGR2GRAY)&lt;br /&gt;
(score, diff) = compare_ssim(grayA, grayB, full=True)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This gets us a ''score'' and diff ''values''.  The ''score'' variables represents how close the to images are to each other and the ''diff'' variables tells us where the differences are.  If the ''score'' indicates that the images are different we then use the ''diff'' value to findContours() and then draw a rectangle around the differences.  &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
thresh = cv2.threshold(diff, 0, 255, cv2.THRESH_BINARY_INV | cv2.THRESH_OTSU)[1]&lt;br /&gt;
contours = cv2.findContours(thresh.copy(), cv2.RETR_EXTERNAL, cv2.CHAIN_APPROX_SIMPLE)&lt;br /&gt;
contours = contours[0] if imutils.is_cv2() else contours[1]&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After getting contours, we get a rectangle for each contour by calling &amp;quot;(x, y, w, h) = cv2.boundingRect(c)&amp;quot;.  We then combine any rectangles that are inside each other or very close to each other.  After combining the rectangles, we then add the rectangles to each image.  Lastly we then save image A (with the rectangles to show the differences)&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
for rrr in rectangles:&lt;br /&gt;
    x = rrr[0]&lt;br /&gt;
    y = rrr[1]&lt;br /&gt;
    w = rrr[2]&lt;br /&gt;
    h = rrr[3]             &lt;br /&gt;
    cv2.rectangle(imageA, (x, y), (x + w, y + h), (0, 0, 255), 2)&lt;br /&gt;
    cv2.rectangle(imageB, (x, y), (x + w, y + h), (0, 0, 255), 2)&lt;br /&gt;
cv2.imwrite(filename,imageA)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
:'''3) Extend the page generation tool with a bunch of additional strategies, such as:'''&lt;br /&gt;
:For task 3 there are several different parts, but the main goal is to increase the complexity of our randomly generated pages. The code_generation.py file will be adapted to provide these functions. The function used to add random sections will have recursion added to generate elements within elements, resulting in a tree of html elements. The amounting of nesting will be random but limited. Within the sections, tables, lists, spans, and divs may potentially be created. This will involve writing new functions for creating each element, and allowing them to be chosen at random by the function that creates sections of the HTML document. Additionally, the function which provides randomized CSS styling will be extended to generate additional properties.&lt;br /&gt;
&lt;br /&gt;
==Testing==&lt;br /&gt;
Because of the nature of this project, testing the newly added features will be very simple. &lt;br /&gt;
: * For task 1, once we are actually controlling Firefox using geckodriver we will know it is working.  &lt;br /&gt;
: * Task 2 actually involves us comparing screenshots.  By running the code with images that are the same and images that are different, we will be able to test to see if the comparisons work.  &lt;br /&gt;
: * Additionally, we will be able to visually test that task 3 is complete (seeing that the new page generation features work).  While we could probably automate some of the testing for task 2 and 3 (to test all possible scenarios) it is out of the scope of this project.&lt;br /&gt;
&lt;br /&gt;
==Conclusion==&lt;br /&gt;
The previously completed work allows us to generate simple html documents with a randomized structure, render the page in Servo, and take a screenshot of the page. We plan on furthering this work by rendering the pages in both Servo and Firefox, taking screenshots of the pages within both browsers, and reporting differences between the two. Doing so will allow users to evaluate Servo’s ability to load web pages. To make this testing even more informative, we plan to increase the complexity of the structure and styling of the randomly generated html documents.&lt;/div&gt;</summary>
		<author><name>Adsimps3</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2018-_Project_M1803:_Implement_a_web_page_fuzzer_to_find_rendering_mismatches_(Part_2)&amp;diff=117053</id>
		<title>CSC/ECE 517 Spring 2018- Project M1803: Implement a web page fuzzer to find rendering mismatches (Part 2)</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2018-_Project_M1803:_Implement_a_web_page_fuzzer_to_find_rendering_mismatches_(Part_2)&amp;diff=117053"/>
		<updated>2018-04-27T20:58:42Z</updated>

		<summary type="html">&lt;p&gt;Adsimps3: /* Implementation of Tasks */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;By Alexander Simpson(adsimps3), Abhay Soni (asoni3), Dileep badveli (dbadvel) and Jake Batty(jbatty)&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
This Mozilla project was broken in to 2 main parts: the previous work and the work to be done.  The previous work was finished as a part of the OSS project.  As a part of the OSS project (explained more below) we created a tool which generates random valid HTML files and automated servo.  [https://en.wikipedia.org/wiki/Servo_(layout_engine) Servo] is experimental web browser developed by Mozilla to &amp;quot;to create a new layout engine using a modern programming language&amp;quot;.  By automating servo (the web browser) we were able to quickly see if servo could render the randomly generated pages.  &lt;br /&gt;
&lt;br /&gt;
The goal of this final project was to build off the original project while adding more features.  The work we completed as a part of this project is split into a couple main parts.  First, we extended the program created in the OSS project to also control Firefox.  By also controlling Firefox, we then had 2 screenshots of the randomly generated content - Servo and Firefox .  After getting both screenshots, we then compared them using Python and OpenCV.  Finally, we were able to expand upon the page generation tool to allow the randomly generated web pages to have more properties/be more complex.&lt;br /&gt;
&lt;br /&gt;
==Previous Work (Part of the OSS Project)==&lt;br /&gt;
&lt;br /&gt;
As per the [https://github.com/servo/servo/wiki/Random-web-content-project project description], we were expected to complete the initial steps. The implementation is explained below for each of these steps.&lt;br /&gt;
&lt;br /&gt;
:1) In a new repository, create a program that can generate a skeleton HTML file with a doctype, head element, and body element, print the result to stdout&lt;br /&gt;
::- Here is the [https://github.com/asoni3/Random-web-content-generator---CSC-517-OSS-Project link] to the repository which contains code_generation.py file which will be used to generate random valid HTML files.&lt;br /&gt;
:2) Add a module to the program that enable generating random content specific to the &amp;lt;head&amp;gt; element (such as inline CSS content inside of a &amp;lt;style&amp;gt; element) and add it to the generated output&lt;br /&gt;
::- The file [https://github.com/asoni3/Random-web-content-generator---CSC-517-OSS-Project/blob/master/code_generation.py code_generation.py], contains the code which generates random content specific to the head element and adds style on top of it. As seen in this code, after generating random content to the file, we will add CSS elements on top of this content. We have established a list of commonly used styles, weights, fonts, font_styles, and alignments which will be used at random. For practical purposes, we are limiting the number of options.&lt;br /&gt;
:3) Add a module to the program that enables generating random content specific to the &amp;lt;body&amp;gt; element (such as a &amp;lt;p&amp;gt; block that contains randomly generated text) and add it to the generated output&lt;br /&gt;
:4) Generate simple random CSS that affects randomly generated content (ie. if there is an element with an id foo, generate a CSS selector like #foo that applies a style like colorto it)&lt;br /&gt;
:5) Create a program under Servo's etc/ that launches Servo and causes it to [https://github.com/servo/servo/wiki/Control-Servo-using-WebDriver take a screenshot] of a particular URL - use this to take screenshots of pages randomly generated by the previous program&lt;br /&gt;
:Sample Screenshot:&lt;br /&gt;
:[[File:Servoscreenshot.png|border]]&lt;br /&gt;
&lt;br /&gt;
==Lists of Tasks==&lt;br /&gt;
Below is a list of the tasks that were completed as a part of our final project.  Below each task we have described how exactly it was implemented with code examples.   &lt;br /&gt;
 &lt;br /&gt;
===1) Extend the program that controls Servo to also control Firefox using geckodriver===&lt;br /&gt;
Task 1 is relatively simple.  It just involves downloading geckodriver and running it.  Geckodriver is an open source software engine that allows us to render marked content on a web browser.  It should allow us to take screenshots of a particular URL, just like task 5 in the previous work section, but for Firefox instead.  &lt;br /&gt;
&lt;br /&gt;
===2) Compare the resulting screenshots and report the contents of the generated page if the screenshots differ===&lt;br /&gt;
This task involves automating Firefox to use geckodriver and the current servo program.  They both will create 2 different screenshots.  If servo and Firefox render it differently, we will report that file and mark the differences.  &lt;br /&gt;
&lt;br /&gt;
===3) Extend the page generation tool with a bunch of additional strategies, such as:===&lt;br /&gt;
====Generating elements trees of arbitrary depth====&lt;br /&gt;
====Generating sibling elements====&lt;br /&gt;
====Extending the set of CSS properties that can be generated (display, background, float, padding, margin, border, etc.)====&lt;br /&gt;
====Extending the set of elements that can be generated (span, div, header elements, table (and associated table contents), etc.)====&lt;br /&gt;
====Randomly choose whether to generate a document in quirks mode or not====&lt;br /&gt;
&lt;br /&gt;
:'''UML Diagram of Tasks:'''&lt;br /&gt;
Below is a UML diagram of the tasks of the overall system.  As you can see, it covers all 3 tasks.  It starts with the code generation and then it splits and takes screenshots on both Firefox and Servo.  It then compares then screenshots and reports the distance.&lt;br /&gt;
:[[File:UMLDiag.jpg|border|]]&lt;br /&gt;
&lt;br /&gt;
==Implementation of Tasks==&lt;br /&gt;
:'''1) Extend the program that controls Servo to also control Firefox using geckodriver'''&lt;br /&gt;
&lt;br /&gt;
:'''2) Compare the resulting screenshots and report the contents of the generated page if the screenshots differ'''&lt;br /&gt;
:To actually make the comparisons we use [https://opencv.org/ OpenCV].  OpenCV allows us to not only make comparisons but will also mark where the differences in.  To actually do the comparisons we will first read in the images, convert the images to grayscale, and then call compare_ssim().  &lt;br /&gt;
:::imageA = cv2.imread(image1)&lt;br /&gt;
:::imageB = cv2.imread(image2)&lt;br /&gt;
:::grayA = cv2.cvtColor(imageA, cv2.COLOR_BGR2GRAY)&lt;br /&gt;
:::grayB = cv2.cvtColor(imageB, cv2.COLOR_BGR2GRAY)&lt;br /&gt;
:::(score, diff) = compare_ssim(grayA, grayB, full=True)&lt;br /&gt;
&lt;br /&gt;
This gets us a ''score'' and diff ''values''.  The ''score'' variables represents how close the to images are to each other and the ''diff'' variables tells us where the differences are.  If the ''score'' indicates that the images are different we then use the ''diff'' value to findContours() and then draw a rectangle around the differences.  &lt;br /&gt;
:::thresh = cv2.threshold(diff, 0, 255, cv2.THRESH_BINARY_INV | cv2.THRESH_OTSU)[1]&lt;br /&gt;
:::contours = cv2.findContours(thresh.copy(), cv2.RETR_EXTERNAL, cv2.CHAIN_APPROX_SIMPLE)&lt;br /&gt;
:::contours = contours[0] if imutils.is_cv2() else contours[1]&lt;br /&gt;
&lt;br /&gt;
After getting contours, we get a rectangle for each contour by calling &amp;quot;(x, y, w, h) = cv2.boundingRect(c)&amp;quot;.  We then combine any rectangles that are inside each other or very close to each other.  After combining the rectangles, we then add the rectangles to each image.  Lastly we then save image A (with the rectangles to show the differences)&lt;br /&gt;
:::for rrr in rectangles:&lt;br /&gt;
:::    x = rrr[0]&lt;br /&gt;
:::    y = rrr[1]&lt;br /&gt;
:::    w = rrr[2]&lt;br /&gt;
:::    h = rrr[3]             &lt;br /&gt;
:::    cv2.rectangle(imageA, (x, y), (x + w, y + h), (0, 0, 255), 2)&lt;br /&gt;
:::    cv2.rectangle(imageB, (x, y), (x + w, y + h), (0, 0, 255), 2)&lt;br /&gt;
:::cv2.imwrite(filename,imageA)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
:'''3) Extend the page generation tool with a bunch of additional strategies, such as:'''&lt;br /&gt;
:For task 3 there are several different parts, but the main goal is to increase the complexity of our randomly generated pages. The code_generation.py file will be adapted to provide these functions. The function used to add random sections will have recursion added to generate elements within elements, resulting in a tree of html elements. The amounting of nesting will be random but limited. Within the sections, tables, lists, spans, and divs may potentially be created. This will involve writing new functions for creating each element, and allowing them to be chosen at random by the function that creates sections of the HTML document. Additionally, the function which provides randomized CSS styling will be extended to generate additional properties.&lt;br /&gt;
&lt;br /&gt;
==Testing==&lt;br /&gt;
Because of the nature of this project, testing the newly added features will be very simple. &lt;br /&gt;
: * For task 1, once we are actually controlling Firefox using geckodriver we will know it is working.  &lt;br /&gt;
: * Task 2 actually involves us comparing screenshots.  By running the code with images that are the same and images that are different, we will be able to test to see if the comparisons work.  &lt;br /&gt;
: * Additionally, we will be able to visually test that task 3 is complete (seeing that the new page generation features work).  While we could probably automate some of the testing for task 2 and 3 (to test all possible scenarios) it is out of the scope of this project.&lt;br /&gt;
&lt;br /&gt;
==Conclusion==&lt;br /&gt;
The previously completed work allows us to generate simple html documents with a randomized structure, render the page in Servo, and take a screenshot of the page. We plan on furthering this work by rendering the pages in both Servo and Firefox, taking screenshots of the pages within both browsers, and reporting differences between the two. Doing so will allow users to evaluate Servo’s ability to load web pages. To make this testing even more informative, we plan to increase the complexity of the structure and styling of the randomly generated html documents.&lt;/div&gt;</summary>
		<author><name>Adsimps3</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2018-_Project_M1803:_Implement_a_web_page_fuzzer_to_find_rendering_mismatches_(Part_2)&amp;diff=117043</id>
		<title>CSC/ECE 517 Spring 2018- Project M1803: Implement a web page fuzzer to find rendering mismatches (Part 2)</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2018-_Project_M1803:_Implement_a_web_page_fuzzer_to_find_rendering_mismatches_(Part_2)&amp;diff=117043"/>
		<updated>2018-04-27T20:50:12Z</updated>

		<summary type="html">&lt;p&gt;Adsimps3: /* Implementation of Tasks */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;By Alexander Simpson(adsimps3), Abhay Soni (asoni3), Dileep badveli (dbadvel) and Jake Batty(jbatty)&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
This Mozilla project was broken in to 2 main parts: the previous work and the work to be done.  The previous work was finished as a part of the OSS project.  As a part of the OSS project (explained more below) we created a tool which generates random valid HTML files and automated servo.  [https://en.wikipedia.org/wiki/Servo_(layout_engine) Servo] is experimental web browser developed by Mozilla to &amp;quot;to create a new layout engine using a modern programming language&amp;quot;.  By automating servo (the web browser) we were able to quickly see if servo could render the randomly generated pages.  &lt;br /&gt;
&lt;br /&gt;
The goal of this final project was to build off the original project while adding more features.  The work we completed as a part of this project is split into a couple main parts.  First, we extended the program created in the OSS project to also control Firefox.  By also controlling Firefox, we then had 2 screenshots of the randomly generated content - Servo and Firefox .  After getting both screenshots, we then compared them using Python and OpenCV.  Finally, we were able to expand upon the page generation tool to allow the randomly generated web pages to have more properties/be more complex.&lt;br /&gt;
&lt;br /&gt;
==Previous Work (Part of the OSS Project)==&lt;br /&gt;
&lt;br /&gt;
As per the [https://github.com/servo/servo/wiki/Random-web-content-project project description], we were expected to complete the initial steps. The implementation is explained below for each of these steps.&lt;br /&gt;
&lt;br /&gt;
:1) In a new repository, create a program that can generate a skeleton HTML file with a doctype, head element, and body element, print the result to stdout&lt;br /&gt;
::- Here is the [https://github.com/asoni3/Random-web-content-generator---CSC-517-OSS-Project link] to the repository which contains code_generation.py file which will be used to generate random valid HTML files.&lt;br /&gt;
:2) Add a module to the program that enable generating random content specific to the &amp;lt;head&amp;gt; element (such as inline CSS content inside of a &amp;lt;style&amp;gt; element) and add it to the generated output&lt;br /&gt;
::- The file [https://github.com/asoni3/Random-web-content-generator---CSC-517-OSS-Project/blob/master/code_generation.py code_generation.py], contains the code which generates random content specific to the head element and adds style on top of it. As seen in this code, after generating random content to the file, we will add CSS elements on top of this content. We have established a list of commonly used styles, weights, fonts, font_styles, and alignments which will be used at random. For practical purposes, we are limiting the number of options.&lt;br /&gt;
:3) Add a module to the program that enables generating random content specific to the &amp;lt;body&amp;gt; element (such as a &amp;lt;p&amp;gt; block that contains randomly generated text) and add it to the generated output&lt;br /&gt;
:4) Generate simple random CSS that affects randomly generated content (ie. if there is an element with an id foo, generate a CSS selector like #foo that applies a style like colorto it)&lt;br /&gt;
:5) Create a program under Servo's etc/ that launches Servo and causes it to [https://github.com/servo/servo/wiki/Control-Servo-using-WebDriver take a screenshot] of a particular URL - use this to take screenshots of pages randomly generated by the previous program&lt;br /&gt;
:Sample Screenshot:&lt;br /&gt;
:[[File:Servoscreenshot.png|border]]&lt;br /&gt;
&lt;br /&gt;
==Lists of Tasks==&lt;br /&gt;
Below is a list of the tasks that were completed as a part of our final project.  Below each task we have described how exactly it was implemented with code examples.   &lt;br /&gt;
 &lt;br /&gt;
==='''1) Extend the program that controls Servo to also control Firefox using geckodriver'''===&lt;br /&gt;
Task 1 is relatively simple.  It just involves downloading geckodriver and running it.  Geckodriver is an open source software engine that allows us to render marked content on a web browser.  It should allow us to take screenshots of a particular URL, just like task 5 in the previous work section, but for Firefox instead.  &lt;br /&gt;
&lt;br /&gt;
:'''2) Compare the resulting screenshots and report the contents of the generated page if the screenshots differ'''&lt;br /&gt;
:This task involves automating Firefox to use geckodriver and the current servo program.  They both will create 2 different screenshots.  If servo and Firefox render it differently, we will report that file and mark the differences.  &lt;br /&gt;
&lt;br /&gt;
:'''3) Extend the page generation tool with a bunch of additional strategies, such as:'''&lt;br /&gt;
::-Generating elements trees of arbitrary depth&lt;br /&gt;
::-Generating sibling elements&lt;br /&gt;
::-Extending the set of CSS properties that can be generated (display, background, float, padding, margin, border, etc.)&lt;br /&gt;
::-Extending the set of elements that can be generated (span, div, header elements, table (and associated table contents), etc.)&lt;br /&gt;
::-Randomly choose whether to generate a document in quirks mode or not&lt;br /&gt;
&lt;br /&gt;
:'''UML Diagram of Tasks:'''&lt;br /&gt;
Below is a UML diagram of the tasks of the overall system.  As you can see, it covers all 3 tasks.  It starts with the code generation and then it splits and takes screenshots on both Firefox and Servo.  It then compares then screenshots and reports the distance.&lt;br /&gt;
:[[File:UMLDiag.jpg|border|]]&lt;br /&gt;
&lt;br /&gt;
==Implementation of Tasks==&lt;br /&gt;
:'''1) Extend the program that controls Servo to also control Firefox using geckodriver'''&lt;br /&gt;
&lt;br /&gt;
:'''2) Compare the resulting screenshots and report the contents of the generated page if the screenshots differ'''&lt;br /&gt;
:To actually make the comparisons we use [https://opencv.org/ OpenCV].  OpenCV allows us to not only make comparisons but will also mark where the differences in.  To actually do the comparisons we will first convert the images to grayscale and then call compare_ssim().  &lt;br /&gt;
:::imageA = cv2.imread(image1)&lt;br /&gt;
:::imageB = cv2.imread(image2)&lt;br /&gt;
This will get us a ''score'' and diff ''values''.  The ''score'' variables represents how close the to images are to each other and the ''diff'' variables tells us where the differences are.  If the ''score'' indicates that the images are different we will use the ''diff'' value to findContours() and then draw a rectangle around the differences.  &lt;br /&gt;
&lt;br /&gt;
:'''3) Extend the page generation tool with a bunch of additional strategies, such as:'''&lt;br /&gt;
:For task 3 there are several different parts, but the main goal is to increase the complexity of our randomly generated pages. The code_generation.py file will be adapted to provide these functions. The function used to add random sections will have recursion added to generate elements within elements, resulting in a tree of html elements. The amounting of nesting will be random but limited. Within the sections, tables, lists, spans, and divs may potentially be created. This will involve writing new functions for creating each element, and allowing them to be chosen at random by the function that creates sections of the HTML document. Additionally, the function which provides randomized CSS styling will be extended to generate additional properties.&lt;br /&gt;
&lt;br /&gt;
==Testing==&lt;br /&gt;
Because of the nature of this project, testing the newly added features will be very simple. &lt;br /&gt;
: * For task 1, once we are actually controlling Firefox using geckodriver we will know it is working.  &lt;br /&gt;
: * Task 2 actually involves us comparing screenshots.  By running the code with images that are the same and images that are different, we will be able to test to see if the comparisons work.  &lt;br /&gt;
: * Additionally, we will be able to visually test that task 3 is complete (seeing that the new page generation features work).  While we could probably automate some of the testing for task 2 and 3 (to test all possible scenarios) it is out of the scope of this project.&lt;br /&gt;
&lt;br /&gt;
==Conclusion==&lt;br /&gt;
The previously completed work allows us to generate simple html documents with a randomized structure, render the page in Servo, and take a screenshot of the page. We plan on furthering this work by rendering the pages in both Servo and Firefox, taking screenshots of the pages within both browsers, and reporting differences between the two. Doing so will allow users to evaluate Servo’s ability to load web pages. To make this testing even more informative, we plan to increase the complexity of the structure and styling of the randomly generated html documents.&lt;/div&gt;</summary>
		<author><name>Adsimps3</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2018-_Project_M1803:_Implement_a_web_page_fuzzer_to_find_rendering_mismatches_(Part_2)&amp;diff=117041</id>
		<title>CSC/ECE 517 Spring 2018- Project M1803: Implement a web page fuzzer to find rendering mismatches (Part 2)</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2018-_Project_M1803:_Implement_a_web_page_fuzzer_to_find_rendering_mismatches_(Part_2)&amp;diff=117041"/>
		<updated>2018-04-27T20:47:53Z</updated>

		<summary type="html">&lt;p&gt;Adsimps3: /* Lists of Tasks */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;By Alexander Simpson(adsimps3), Abhay Soni (asoni3), Dileep badveli (dbadvel) and Jake Batty(jbatty)&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
This Mozilla project was broken in to 2 main parts: the previous work and the work to be done.  The previous work was finished as a part of the OSS project.  As a part of the OSS project (explained more below) we created a tool which generates random valid HTML files and automated servo.  [https://en.wikipedia.org/wiki/Servo_(layout_engine) Servo] is experimental web browser developed by Mozilla to &amp;quot;to create a new layout engine using a modern programming language&amp;quot;.  By automating servo (the web browser) we were able to quickly see if servo could render the randomly generated pages.  &lt;br /&gt;
&lt;br /&gt;
The goal of this final project was to build off the original project while adding more features.  The work we completed as a part of this project is split into a couple main parts.  First, we extended the program created in the OSS project to also control Firefox.  By also controlling Firefox, we then had 2 screenshots of the randomly generated content - Servo and Firefox .  After getting both screenshots, we then compared them using Python and OpenCV.  Finally, we were able to expand upon the page generation tool to allow the randomly generated web pages to have more properties/be more complex.&lt;br /&gt;
&lt;br /&gt;
==Previous Work (Part of the OSS Project)==&lt;br /&gt;
&lt;br /&gt;
As per the [https://github.com/servo/servo/wiki/Random-web-content-project project description], we were expected to complete the initial steps. The implementation is explained below for each of these steps.&lt;br /&gt;
&lt;br /&gt;
:1) In a new repository, create a program that can generate a skeleton HTML file with a doctype, head element, and body element, print the result to stdout&lt;br /&gt;
::- Here is the [https://github.com/asoni3/Random-web-content-generator---CSC-517-OSS-Project link] to the repository which contains code_generation.py file which will be used to generate random valid HTML files.&lt;br /&gt;
:2) Add a module to the program that enable generating random content specific to the &amp;lt;head&amp;gt; element (such as inline CSS content inside of a &amp;lt;style&amp;gt; element) and add it to the generated output&lt;br /&gt;
::- The file [https://github.com/asoni3/Random-web-content-generator---CSC-517-OSS-Project/blob/master/code_generation.py code_generation.py], contains the code which generates random content specific to the head element and adds style on top of it. As seen in this code, after generating random content to the file, we will add CSS elements on top of this content. We have established a list of commonly used styles, weights, fonts, font_styles, and alignments which will be used at random. For practical purposes, we are limiting the number of options.&lt;br /&gt;
:3) Add a module to the program that enables generating random content specific to the &amp;lt;body&amp;gt; element (such as a &amp;lt;p&amp;gt; block that contains randomly generated text) and add it to the generated output&lt;br /&gt;
:4) Generate simple random CSS that affects randomly generated content (ie. if there is an element with an id foo, generate a CSS selector like #foo that applies a style like colorto it)&lt;br /&gt;
:5) Create a program under Servo's etc/ that launches Servo and causes it to [https://github.com/servo/servo/wiki/Control-Servo-using-WebDriver take a screenshot] of a particular URL - use this to take screenshots of pages randomly generated by the previous program&lt;br /&gt;
:Sample Screenshot:&lt;br /&gt;
:[[File:Servoscreenshot.png|border]]&lt;br /&gt;
&lt;br /&gt;
==Lists of Tasks==&lt;br /&gt;
Below is a list of the tasks that were completed as a part of our final project.  Below each task we have described how exactly it was implemented with code examples.   &lt;br /&gt;
 &lt;br /&gt;
:'''1) Extend the program that controls Servo to also control Firefox using geckodriver'''&lt;br /&gt;
:Task 1 is relatively simple.  It just involves downloading geckodriver and running it.  Geckodriver is an open source software engine that allows us to render marked content on a web browser.  It should allow us to take screenshots of a particular URL, just like task 5 in the previous work section, but for Firefox instead.  &lt;br /&gt;
&lt;br /&gt;
:'''2) Compare the resulting screenshots and report the contents of the generated page if the screenshots differ'''&lt;br /&gt;
:This task involves automating Firefox to use geckodriver and the current servo program.  They both will create 2 different screenshots.  If servo and Firefox render it differently, we will report that file and mark the differences.  &lt;br /&gt;
&lt;br /&gt;
:'''3) Extend the page generation tool with a bunch of additional strategies, such as:'''&lt;br /&gt;
::-Generating elements trees of arbitrary depth&lt;br /&gt;
::-Generating sibling elements&lt;br /&gt;
::-Extending the set of CSS properties that can be generated (display, background, float, padding, margin, border, etc.)&lt;br /&gt;
::-Extending the set of elements that can be generated (span, div, header elements, table (and associated table contents), etc.)&lt;br /&gt;
::-Randomly choose whether to generate a document in quirks mode or not&lt;br /&gt;
&lt;br /&gt;
:'''UML Diagram of Tasks:'''&lt;br /&gt;
Below is a UML diagram of the tasks of the overall system.  As you can see, it covers all 3 tasks.  It starts with the code generation and then it splits and takes screenshots on both Firefox and Servo.  It then compares then screenshots and reports the distance.&lt;br /&gt;
:[[File:UMLDiag.jpg|border|]]&lt;br /&gt;
&lt;br /&gt;
==Implementation of Tasks==&lt;br /&gt;
:'''1) Extend the program that controls Servo to also control Firefox using geckodriver'''&lt;br /&gt;
&lt;br /&gt;
:'''2) Compare the resulting screenshots and report the contents of the generated page if the screenshots differ'''&lt;br /&gt;
:To actually make the comparisons we will use [https://opencv.org/ OpenCV].  OpenCV will allow us to not only make comparisons but will also mark where the differences in.  To actually do the comparisons we will first convert the images to grayscale and then call compare_ssim().  This will get us a ''score'' and diff ''values''.  The ''score'' variables represents how close the to images are to each other and the ''diff'' variables tells us where the differences are.  If the ''score'' indicates that the images are different we will use the ''diff'' value to findContours() and then draw a rectangle around the differences.  &lt;br /&gt;
&lt;br /&gt;
:'''3) Extend the page generation tool with a bunch of additional strategies, such as:'''&lt;br /&gt;
:For task 3 there are several different parts, but the main goal is to increase the complexity of our randomly generated pages. The code_generation.py file will be adapted to provide these functions. The function used to add random sections will have recursion added to generate elements within elements, resulting in a tree of html elements. The amounting of nesting will be random but limited. Within the sections, tables, lists, spans, and divs may potentially be created. This will involve writing new functions for creating each element, and allowing them to be chosen at random by the function that creates sections of the HTML document. Additionally, the function which provides randomized CSS styling will be extended to generate additional properties.&lt;br /&gt;
&lt;br /&gt;
==Testing==&lt;br /&gt;
Because of the nature of this project, testing the newly added features will be very simple. &lt;br /&gt;
: * For task 1, once we are actually controlling Firefox using geckodriver we will know it is working.  &lt;br /&gt;
: * Task 2 actually involves us comparing screenshots.  By running the code with images that are the same and images that are different, we will be able to test to see if the comparisons work.  &lt;br /&gt;
: * Additionally, we will be able to visually test that task 3 is complete (seeing that the new page generation features work).  While we could probably automate some of the testing for task 2 and 3 (to test all possible scenarios) it is out of the scope of this project.&lt;br /&gt;
&lt;br /&gt;
==Conclusion==&lt;br /&gt;
The previously completed work allows us to generate simple html documents with a randomized structure, render the page in Servo, and take a screenshot of the page. We plan on furthering this work by rendering the pages in both Servo and Firefox, taking screenshots of the pages within both browsers, and reporting differences between the two. Doing so will allow users to evaluate Servo’s ability to load web pages. To make this testing even more informative, we plan to increase the complexity of the structure and styling of the randomly generated html documents.&lt;/div&gt;</summary>
		<author><name>Adsimps3</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2018-_Project_M1803:_Implement_a_web_page_fuzzer_to_find_rendering_mismatches_(Part_2)&amp;diff=117039</id>
		<title>CSC/ECE 517 Spring 2018- Project M1803: Implement a web page fuzzer to find rendering mismatches (Part 2)</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2018-_Project_M1803:_Implement_a_web_page_fuzzer_to_find_rendering_mismatches_(Part_2)&amp;diff=117039"/>
		<updated>2018-04-27T20:45:42Z</updated>

		<summary type="html">&lt;p&gt;Adsimps3: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;By Alexander Simpson(adsimps3), Abhay Soni (asoni3), Dileep badveli (dbadvel) and Jake Batty(jbatty)&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
This Mozilla project was broken in to 2 main parts: the previous work and the work to be done.  The previous work was finished as a part of the OSS project.  As a part of the OSS project (explained more below) we created a tool which generates random valid HTML files and automated servo.  [https://en.wikipedia.org/wiki/Servo_(layout_engine) Servo] is experimental web browser developed by Mozilla to &amp;quot;to create a new layout engine using a modern programming language&amp;quot;.  By automating servo (the web browser) we were able to quickly see if servo could render the randomly generated pages.  &lt;br /&gt;
&lt;br /&gt;
The goal of this final project was to build off the original project while adding more features.  The work we completed as a part of this project is split into a couple main parts.  First, we extended the program created in the OSS project to also control Firefox.  By also controlling Firefox, we then had 2 screenshots of the randomly generated content - Servo and Firefox .  After getting both screenshots, we then compared them using Python and OpenCV.  Finally, we were able to expand upon the page generation tool to allow the randomly generated web pages to have more properties/be more complex.&lt;br /&gt;
&lt;br /&gt;
==Previous Work (Part of the OSS Project)==&lt;br /&gt;
&lt;br /&gt;
As per the [https://github.com/servo/servo/wiki/Random-web-content-project project description], we were expected to complete the initial steps. The implementation is explained below for each of these steps.&lt;br /&gt;
&lt;br /&gt;
:1) In a new repository, create a program that can generate a skeleton HTML file with a doctype, head element, and body element, print the result to stdout&lt;br /&gt;
::- Here is the [https://github.com/asoni3/Random-web-content-generator---CSC-517-OSS-Project link] to the repository which contains code_generation.py file which will be used to generate random valid HTML files.&lt;br /&gt;
:2) Add a module to the program that enable generating random content specific to the &amp;lt;head&amp;gt; element (such as inline CSS content inside of a &amp;lt;style&amp;gt; element) and add it to the generated output&lt;br /&gt;
::- The file [https://github.com/asoni3/Random-web-content-generator---CSC-517-OSS-Project/blob/master/code_generation.py code_generation.py], contains the code which generates random content specific to the head element and adds style on top of it. As seen in this code, after generating random content to the file, we will add CSS elements on top of this content. We have established a list of commonly used styles, weights, fonts, font_styles, and alignments which will be used at random. For practical purposes, we are limiting the number of options.&lt;br /&gt;
:3) Add a module to the program that enables generating random content specific to the &amp;lt;body&amp;gt; element (such as a &amp;lt;p&amp;gt; block that contains randomly generated text) and add it to the generated output&lt;br /&gt;
:4) Generate simple random CSS that affects randomly generated content (ie. if there is an element with an id foo, generate a CSS selector like #foo that applies a style like colorto it)&lt;br /&gt;
:5) Create a program under Servo's etc/ that launches Servo and causes it to [https://github.com/servo/servo/wiki/Control-Servo-using-WebDriver take a screenshot] of a particular URL - use this to take screenshots of pages randomly generated by the previous program&lt;br /&gt;
:Sample Screenshot:&lt;br /&gt;
:[[File:Servoscreenshot.png|border]]&lt;br /&gt;
&lt;br /&gt;
==Lists of Tasks==&lt;br /&gt;
Below is a list of the tasks that were completed as a part of our final project.  Below each task we have described how exactly it was implemented with code examples.   &lt;br /&gt;
 &lt;br /&gt;
:'''1) Extend the program that controls Servo to also control Firefox using geckodriver'''&lt;br /&gt;
:Task 1 is relatively simple.  It just involves downloading geckodriver and running it.  Geckodriver is an open source software engine that allows us to render marked content on a web browser.  It should allow us to take screenshots of a particular URL, just like task 5 in the previous work section, but for Firefox instead.  &lt;br /&gt;
&lt;br /&gt;
:'''2) Compare the resulting screenshots and report the contents of the generated page if the screenshots differ'''&lt;br /&gt;
:This task involves automating Firefox to use geckodriver and the current servo program.  They both will create 2 different screenshots.  If servo and Firefox render it differently, we will report that file and mark the differences.  &lt;br /&gt;
&lt;br /&gt;
:'''3) Extend the page generation tool with a bunch of additional strategies, such as:'''&lt;br /&gt;
::-Generating elements trees of arbitrary depth&lt;br /&gt;
::-Generating sibling elements&lt;br /&gt;
::-Extending the set of CSS properties that can be generated (display, background, float, padding, margin, border, etc.)&lt;br /&gt;
::-Extending the set of elements that can be generated (span, div, header elements, table (and associated table contents), etc.)&lt;br /&gt;
::-Randomly choose whether to generate a document in quirks mode or not&lt;br /&gt;
&lt;br /&gt;
:'''3) UML Diagram of Tasks:'''&lt;br /&gt;
Below is a UML diagram of the tasks that we have completed.  As you can see, it covers all 3 tasks. &lt;br /&gt;
:[[File:UMLDiag.jpg|border|]]&lt;br /&gt;
&lt;br /&gt;
==Implementation of Tasks==&lt;br /&gt;
:'''1) Extend the program that controls Servo to also control Firefox using geckodriver'''&lt;br /&gt;
&lt;br /&gt;
:'''2) Compare the resulting screenshots and report the contents of the generated page if the screenshots differ'''&lt;br /&gt;
:To actually make the comparisons we will use [https://opencv.org/ OpenCV].  OpenCV will allow us to not only make comparisons but will also mark where the differences in.  To actually do the comparisons we will first convert the images to grayscale and then call compare_ssim().  This will get us a ''score'' and diff ''values''.  The ''score'' variables represents how close the to images are to each other and the ''diff'' variables tells us where the differences are.  If the ''score'' indicates that the images are different we will use the ''diff'' value to findContours() and then draw a rectangle around the differences.  &lt;br /&gt;
&lt;br /&gt;
:'''3) Extend the page generation tool with a bunch of additional strategies, such as:'''&lt;br /&gt;
:For task 3 there are several different parts, but the main goal is to increase the complexity of our randomly generated pages. The code_generation.py file will be adapted to provide these functions. The function used to add random sections will have recursion added to generate elements within elements, resulting in a tree of html elements. The amounting of nesting will be random but limited. Within the sections, tables, lists, spans, and divs may potentially be created. This will involve writing new functions for creating each element, and allowing them to be chosen at random by the function that creates sections of the HTML document. Additionally, the function which provides randomized CSS styling will be extended to generate additional properties.&lt;br /&gt;
&lt;br /&gt;
==Testing==&lt;br /&gt;
Because of the nature of this project, testing the newly added features will be very simple. &lt;br /&gt;
: * For task 1, once we are actually controlling Firefox using geckodriver we will know it is working.  &lt;br /&gt;
: * Task 2 actually involves us comparing screenshots.  By running the code with images that are the same and images that are different, we will be able to test to see if the comparisons work.  &lt;br /&gt;
: * Additionally, we will be able to visually test that task 3 is complete (seeing that the new page generation features work).  While we could probably automate some of the testing for task 2 and 3 (to test all possible scenarios) it is out of the scope of this project.&lt;br /&gt;
&lt;br /&gt;
==Conclusion==&lt;br /&gt;
The previously completed work allows us to generate simple html documents with a randomized structure, render the page in Servo, and take a screenshot of the page. We plan on furthering this work by rendering the pages in both Servo and Firefox, taking screenshots of the pages within both browsers, and reporting differences between the two. Doing so will allow users to evaluate Servo’s ability to load web pages. To make this testing even more informative, we plan to increase the complexity of the structure and styling of the randomly generated html documents.&lt;/div&gt;</summary>
		<author><name>Adsimps3</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2018-_Project_M1803:_Implement_a_web_page_fuzzer_to_find_rendering_mismatches_(Part_2)&amp;diff=117037</id>
		<title>CSC/ECE 517 Spring 2018- Project M1803: Implement a web page fuzzer to find rendering mismatches (Part 2)</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2018-_Project_M1803:_Implement_a_web_page_fuzzer_to_find_rendering_mismatches_(Part_2)&amp;diff=117037"/>
		<updated>2018-04-27T20:42:20Z</updated>

		<summary type="html">&lt;p&gt;Adsimps3: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;By Alexander Simpson(adsimps3), Abhay Soni (asoni3), Dileep badveli (dbadvel) and Jake Batty(jbatty)&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
This Mozilla project was broken in to 2 main parts: the previous work and the work to be done.  The previous work was finished as a part of the OSS project.  As a part of the OSS project (explained more below) we created a tool which generates random valid HTML files and automated servo.  [https://en.wikipedia.org/wiki/Servo_(layout_engine) Servo] is experimental web browser developed by Mozilla to &amp;quot;to create a new layout engine using a modern programming language&amp;quot;.  By automating servo (the web browser) we were able to quickly see if servo could render the randomly generated pages.  &lt;br /&gt;
&lt;br /&gt;
The goal of this final project was to build off the original project while adding more features.  The work we completed as a part of this project is split into a couple main parts.  First, we extended the program created in the OSS project to also control Firefox.  By also controlling Firefox, we then had 2 screenshots of the randomly generated content - Servo and Firefox .  After getting both screenshots, we then compared them using Python and OpenCV.  Finally, we were able to expand upon the page generation tool to allow the randomly generated web pages to have more properties/be more complex.&lt;br /&gt;
&lt;br /&gt;
==Previous Work (Part of the OSS Project)==&lt;br /&gt;
&lt;br /&gt;
As per the [https://github.com/servo/servo/wiki/Random-web-content-project project description], we were expected to complete the initial steps. The implementation is explained below for each of these steps.&lt;br /&gt;
&lt;br /&gt;
:1) In a new repository, create a program that can generate a skeleton HTML file with a doctype, head element, and body element, print the result to stdout&lt;br /&gt;
::- Here is the [https://github.com/asoni3/Random-web-content-generator---CSC-517-OSS-Project link] to the repository which contains code_generation.py file which will be used to generate random valid HTML files.&lt;br /&gt;
:2) Add a module to the program that enable generating random content specific to the &amp;lt;head&amp;gt; element (such as inline CSS content inside of a &amp;lt;style&amp;gt; element) and add it to the generated output&lt;br /&gt;
::- The file [https://github.com/asoni3/Random-web-content-generator---CSC-517-OSS-Project/blob/master/code_generation.py code_generation.py], contains the code which generates random content specific to the head element and adds style on top of it. As seen in this code, after generating random content to the file, we will add CSS elements on top of this content. We have established a list of commonly used styles, weights, fonts, font_styles, and alignments which will be used at random. For practical purposes, we are limiting the number of options.&lt;br /&gt;
:3) Add a module to the program that enables generating random content specific to the &amp;lt;body&amp;gt; element (such as a &amp;lt;p&amp;gt; block that contains randomly generated text) and add it to the generated output&lt;br /&gt;
:4) Generate simple random CSS that affects randomly generated content (ie. if there is an element with an id foo, generate a CSS selector like #foo that applies a style like colorto it)&lt;br /&gt;
:5) Create a program under Servo's etc/ that launches Servo and causes it to [https://github.com/servo/servo/wiki/Control-Servo-using-WebDriver take a screenshot] of a particular URL - use this to take screenshots of pages randomly generated by the previous program&lt;br /&gt;
:Sample Screenshot:&lt;br /&gt;
:[[File:Servoscreenshot.png|border]]&lt;br /&gt;
&lt;br /&gt;
==Lists of Tasks==&lt;br /&gt;
Below is a list of the tasks that were completed as a part of our final project.  Below each task we have described how exactly it was implemented with code examples.   &lt;br /&gt;
 &lt;br /&gt;
:'''1) Extend the program that controls Servo to also control Firefox using geckodriver'''&lt;br /&gt;
:Task 1 is relatively simple.  It just involves downloading geckodriver and running it.  Geckodriver is an open source software engine that allows us to render marked content on a web browser.  It should allow us to take screenshots of a particular URL, just like task 5 in the previous work section, but for Firefox instead.  &lt;br /&gt;
&lt;br /&gt;
:'''2) Compare the resulting screenshots and report the contents of the generated page if the screenshots differ'''&lt;br /&gt;
:This task involves automating Firefox to use geckodriver and the current servo program.  They both will create 2 different screenshots.  If servo and Firefox render it differently, we will report that file and mark the differences.  &lt;br /&gt;
:To actually make the comparisons we will use [https://opencv.org/ OpenCV].  OpenCV will allow us to not only make comparisons but will also mark where the differences in.  To actually do the comparisons we will first convert the images to grayscale and then call compare_ssim().  This will get us a ''score'' and diff ''values''.  The ''score'' variables represents how close the to images are to each other and the ''diff'' variables tells us where the differences are.  If the ''score'' indicates that the images are different we will use the ''diff'' value to findContours() and then draw a rectangle around the differences.  &lt;br /&gt;
:[[File:UMLDiag.jpg|border|]]&lt;br /&gt;
:'''3) Extend the page generation tool with a bunch of additional strategies, such as:'''&lt;br /&gt;
::-Generating elements trees of arbitrary depth&lt;br /&gt;
::-Generating sibling elements&lt;br /&gt;
::-Extending the set of CSS properties that can be generated (display, background, float, padding, margin, border, etc.)&lt;br /&gt;
::-Extending the set of elements that can be generated (span, div, header elements, table (and associated table contents), etc.)&lt;br /&gt;
::-Randomly choose whether to generate a document in quirks mode or not&lt;br /&gt;
&lt;br /&gt;
:For task 3 there are several different parts, but the main goal is to increase the complexity of our randomly generated pages. The code_generation.py file will be adapted to provide these functions. The function used to add random sections will have recursion added to generate elements within elements, resulting in a tree of html elements. The amounting of nesting will be random but limited. Within the sections, tables, lists, spans, and divs may potentially be created. This will involve writing new functions for creating each element, and allowing them to be chosen at random by the function that creates sections of the HTML document. Additionally, the function which provides randomized CSS styling will be extended to generate additional properties.&lt;br /&gt;
&lt;br /&gt;
==Implementation of Tasks==&lt;br /&gt;
&lt;br /&gt;
==Testing==&lt;br /&gt;
Because of the nature of this project, testing the newly added features will be very simple. &lt;br /&gt;
: * For task 1, once we are actually controlling Firefox using geckodriver we will know it is working.  &lt;br /&gt;
: * Task 2 actually involves us comparing screenshots.  By running the code with images that are the same and images that are different, we will be able to test to see if the comparisons work.  &lt;br /&gt;
: * Additionally, we will be able to visually test that task 3 is complete (seeing that the new page generation features work).  While we could probably automate some of the testing for task 2 and 3 (to test all possible scenarios) it is out of the scope of this project.&lt;br /&gt;
&lt;br /&gt;
==Conclusion==&lt;br /&gt;
The previously completed work allows us to generate simple html documents with a randomized structure, render the page in Servo, and take a screenshot of the page. We plan on furthering this work by rendering the pages in both Servo and Firefox, taking screenshots of the pages within both browsers, and reporting differences between the two. Doing so will allow users to evaluate Servo’s ability to load web pages. To make this testing even more informative, we plan to increase the complexity of the structure and styling of the randomly generated html documents.&lt;/div&gt;</summary>
		<author><name>Adsimps3</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2018-_Project_M1803:_Implement_a_web_page_fuzzer_to_find_rendering_mismatches_(Part_2)&amp;diff=117036</id>
		<title>CSC/ECE 517 Spring 2018- Project M1803: Implement a web page fuzzer to find rendering mismatches (Part 2)</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2018-_Project_M1803:_Implement_a_web_page_fuzzer_to_find_rendering_mismatches_(Part_2)&amp;diff=117036"/>
		<updated>2018-04-27T20:41:49Z</updated>

		<summary type="html">&lt;p&gt;Adsimps3: /* Work Completed */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;By Alexander Simpson(adsimps3), Abhay Soni (asoni3), Dileep badveli (dbadvel) and Jake Batty(jbatty)&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
This Mozilla project was broken in to 2 main parts: the previous work and the work to be done.  The previous work was finished as a part of the OSS project.  As a part of the OSS project (explained more below) we created a tool which generates random valid HTML files and automated servo.  [https://en.wikipedia.org/wiki/Servo_(layout_engine) Servo] is experimental web browser developed by Mozilla to &amp;quot;to create a new layout engine using a modern programming language&amp;quot;.  By automating servo (the web browser) we were able to quickly see if servo could render the randomly generated pages.  &lt;br /&gt;
&lt;br /&gt;
The goal of this final project was to build off the original project while adding more features.  The work we completed as a part of this project is split into a couple main parts.  First, we extended the program created in the OSS project to also control Firefox.  By also controlling Firefox, we then had 2 screenshots of the randomly generated content - Servo and Firefox .  After getting both screenshots, we then compared them using Python and OpenCV.  Finally, we were able to expand upon the page generation tool to allow the randomly generated web pages to have more properties/be more complex.&lt;br /&gt;
&lt;br /&gt;
==Previous Work (Part of the OSS Project)==&lt;br /&gt;
&lt;br /&gt;
As per the [https://github.com/servo/servo/wiki/Random-web-content-project project description], we were expected to complete the initial steps. The implementation is explained below for each of these steps.&lt;br /&gt;
&lt;br /&gt;
:1) In a new repository, create a program that can generate a skeleton HTML file with a doctype, head element, and body element, print the result to stdout&lt;br /&gt;
::- Here is the [https://github.com/asoni3/Random-web-content-generator---CSC-517-OSS-Project link] to the repository which contains code_generation.py file which will be used to generate random valid HTML files.&lt;br /&gt;
:2) Add a module to the program that enable generating random content specific to the &amp;lt;head&amp;gt; element (such as inline CSS content inside of a &amp;lt;style&amp;gt; element) and add it to the generated output&lt;br /&gt;
::- The file [https://github.com/asoni3/Random-web-content-generator---CSC-517-OSS-Project/blob/master/code_generation.py code_generation.py], contains the code which generates random content specific to the head element and adds style on top of it. As seen in this code, after generating random content to the file, we will add CSS elements on top of this content. We have established a list of commonly used styles, weights, fonts, font_styles, and alignments which will be used at random. For practical purposes, we are limiting the number of options.&lt;br /&gt;
:3) Add a module to the program that enables generating random content specific to the &amp;lt;body&amp;gt; element (such as a &amp;lt;p&amp;gt; block that contains randomly generated text) and add it to the generated output&lt;br /&gt;
:4) Generate simple random CSS that affects randomly generated content (ie. if there is an element with an id foo, generate a CSS selector like #foo that applies a style like colorto it)&lt;br /&gt;
:5) Create a program under Servo's etc/ that launches Servo and causes it to [https://github.com/servo/servo/wiki/Control-Servo-using-WebDriver take a screenshot] of a particular URL - use this to take screenshots of pages randomly generated by the previous program&lt;br /&gt;
:Sample Screenshot:&lt;br /&gt;
:[[File:Servoscreenshot.png|border]]&lt;br /&gt;
&lt;br /&gt;
==Lists of Tasks==&lt;br /&gt;
Below is a list of the tasks that were completed as a part of our final project.  Below each task we have described how exactly it was implemented with code examples.   &lt;br /&gt;
 &lt;br /&gt;
:'''1) Extend the program that controls Servo to also control Firefox using geckodriver'''&lt;br /&gt;
:Task 1 is relatively simple.  It just involves downloading geckodriver and running it.  Geckodriver is an open source software engine that allows us to render marked content on a web browser.  It should allow us to take screenshots of a particular URL, just like task 5 in the previous work section, but for Firefox instead.  &lt;br /&gt;
&lt;br /&gt;
:'''2) Compare the resulting screenshots and report the contents of the generated page if the screenshots differ'''&lt;br /&gt;
:This task involves automating Firefox to use geckodriver and the current servo program.  They both will create 2 different screenshots.  If servo and Firefox render it differently, we will report that file and mark the differences.  &lt;br /&gt;
:To actually make the comparisons we will use [https://opencv.org/ OpenCV].  OpenCV will allow us to not only make comparisons but will also mark where the differences in.  To actually do the comparisons we will first convert the images to grayscale and then call compare_ssim().  This will get us a ''score'' and diff ''values''.  The ''score'' variables represents how close the to images are to each other and the ''diff'' variables tells us where the differences are.  If the ''score'' indicates that the images are different we will use the ''diff'' value to findContours() and then draw a rectangle around the differences.  &lt;br /&gt;
:[[File:UMLDiag.jpg|border|]]&lt;br /&gt;
:'''3) Extend the page generation tool with a bunch of additional strategies, such as:'''&lt;br /&gt;
::-Generating elements trees of arbitrary depth&lt;br /&gt;
::-Generating sibling elements&lt;br /&gt;
::-Extending the set of CSS properties that can be generated (display, background, float, padding, margin, border, etc.)&lt;br /&gt;
::-Extending the set of elements that can be generated (span, div, header elements, table (and associated table contents), etc.)&lt;br /&gt;
::-Randomly choose whether to generate a document in quirks mode or not&lt;br /&gt;
&lt;br /&gt;
:For task 3 there are several different parts, but the main goal is to increase the complexity of our randomly generated pages. The code_generation.py file will be adapted to provide these functions. The function used to add random sections will have recursion added to generate elements within elements, resulting in a tree of html elements. The amounting of nesting will be random but limited. Within the sections, tables, lists, spans, and divs may potentially be created. This will involve writing new functions for creating each element, and allowing them to be chosen at random by the function that creates sections of the HTML document. Additionally, the function which provides randomized CSS styling will be extended to generate additional properties.&lt;br /&gt;
&lt;br /&gt;
==Testing==&lt;br /&gt;
Because of the nature of this project, testing the newly added features will be very simple. &lt;br /&gt;
: * For task 1, once we are actually controlling Firefox using geckodriver we will know it is working.  &lt;br /&gt;
: * Task 2 actually involves us comparing screenshots.  By running the code with images that are the same and images that are different, we will be able to test to see if the comparisons work.  &lt;br /&gt;
: * Additionally, we will be able to visually test that task 3 is complete (seeing that the new page generation features work).  While we could probably automate some of the testing for task 2 and 3 (to test all possible scenarios) it is out of the scope of this project.&lt;br /&gt;
&lt;br /&gt;
==Conclusion==&lt;br /&gt;
The previously completed work allows us to generate simple html documents with a randomized structure, render the page in Servo, and take a screenshot of the page. We plan on furthering this work by rendering the pages in both Servo and Firefox, taking screenshots of the pages within both browsers, and reporting differences between the two. Doing so will allow users to evaluate Servo’s ability to load web pages. To make this testing even more informative, we plan to increase the complexity of the structure and styling of the randomly generated html documents.&lt;/div&gt;</summary>
		<author><name>Adsimps3</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2018-_Project_M1803:_Implement_a_web_page_fuzzer_to_find_rendering_mismatches_(Part_2)&amp;diff=117035</id>
		<title>CSC/ECE 517 Spring 2018- Project M1803: Implement a web page fuzzer to find rendering mismatches (Part 2)</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2018-_Project_M1803:_Implement_a_web_page_fuzzer_to_find_rendering_mismatches_(Part_2)&amp;diff=117035"/>
		<updated>2018-04-27T20:41:16Z</updated>

		<summary type="html">&lt;p&gt;Adsimps3: /* Introduction */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;By Alexander Simpson(adsimps3), Abhay Soni (asoni3), Dileep badveli (dbadvel) and Jake Batty(jbatty)&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
This Mozilla project was broken in to 2 main parts: the previous work and the work to be done.  The previous work was finished as a part of the OSS project.  As a part of the OSS project (explained more below) we created a tool which generates random valid HTML files and automated servo.  [https://en.wikipedia.org/wiki/Servo_(layout_engine) Servo] is experimental web browser developed by Mozilla to &amp;quot;to create a new layout engine using a modern programming language&amp;quot;.  By automating servo (the web browser) we were able to quickly see if servo could render the randomly generated pages.  &lt;br /&gt;
&lt;br /&gt;
The goal of this final project was to build off the original project while adding more features.  The work we completed as a part of this project is split into a couple main parts.  First, we extended the program created in the OSS project to also control Firefox.  By also controlling Firefox, we then had 2 screenshots of the randomly generated content - Servo and Firefox .  After getting both screenshots, we then compared them using Python and OpenCV.  Finally, we were able to expand upon the page generation tool to allow the randomly generated web pages to have more properties/be more complex.&lt;br /&gt;
&lt;br /&gt;
==Previous Work (Part of the OSS Project)==&lt;br /&gt;
&lt;br /&gt;
As per the [https://github.com/servo/servo/wiki/Random-web-content-project project description], we were expected to complete the initial steps. The implementation is explained below for each of these steps.&lt;br /&gt;
&lt;br /&gt;
:1) In a new repository, create a program that can generate a skeleton HTML file with a doctype, head element, and body element, print the result to stdout&lt;br /&gt;
::- Here is the [https://github.com/asoni3/Random-web-content-generator---CSC-517-OSS-Project link] to the repository which contains code_generation.py file which will be used to generate random valid HTML files.&lt;br /&gt;
:2) Add a module to the program that enable generating random content specific to the &amp;lt;head&amp;gt; element (such as inline CSS content inside of a &amp;lt;style&amp;gt; element) and add it to the generated output&lt;br /&gt;
::- The file [https://github.com/asoni3/Random-web-content-generator---CSC-517-OSS-Project/blob/master/code_generation.py code_generation.py], contains the code which generates random content specific to the head element and adds style on top of it. As seen in this code, after generating random content to the file, we will add CSS elements on top of this content. We have established a list of commonly used styles, weights, fonts, font_styles, and alignments which will be used at random. For practical purposes, we are limiting the number of options.&lt;br /&gt;
:3) Add a module to the program that enables generating random content specific to the &amp;lt;body&amp;gt; element (such as a &amp;lt;p&amp;gt; block that contains randomly generated text) and add it to the generated output&lt;br /&gt;
:4) Generate simple random CSS that affects randomly generated content (ie. if there is an element with an id foo, generate a CSS selector like #foo that applies a style like colorto it)&lt;br /&gt;
:5) Create a program under Servo's etc/ that launches Servo and causes it to [https://github.com/servo/servo/wiki/Control-Servo-using-WebDriver take a screenshot] of a particular URL - use this to take screenshots of pages randomly generated by the previous program&lt;br /&gt;
:Sample Screenshot:&lt;br /&gt;
:[[File:Servoscreenshot.png|border]]&lt;br /&gt;
&lt;br /&gt;
==Work Completed==&lt;br /&gt;
Below is a list of the tasks that were completed as a part of our final project.  Below each task we have described how exactly it was implemented with code examples.   &lt;br /&gt;
 &lt;br /&gt;
:'''1) Extend the program that controls Servo to also control Firefox using geckodriver'''&lt;br /&gt;
:Task 1 is relatively simple.  It just involves downloading geckodriver and running it.  Geckodriver is an open source software engine that allows us to render marked content on a web browser.  It should allow us to take screenshots of a particular URL, just like task 5 in the previous work section, but for Firefox instead.  &lt;br /&gt;
&lt;br /&gt;
:'''2) Compare the resulting screenshots and report the contents of the generated page if the screenshots differ'''&lt;br /&gt;
:This task involves automating Firefox to use geckodriver and the current servo program.  They both will create 2 different screenshots.  If servo and Firefox render it differently, we will report that file and mark the differences.  &lt;br /&gt;
:To actually make the comparisons we will use [https://opencv.org/ OpenCV].  OpenCV will allow us to not only make comparisons but will also mark where the differences in.  To actually do the comparisons we will first convert the images to grayscale and then call compare_ssim().  This will get us a ''score'' and diff ''values''.  The ''score'' variables represents how close the to images are to each other and the ''diff'' variables tells us where the differences are.  If the ''score'' indicates that the images are different we will use the ''diff'' value to findContours() and then draw a rectangle around the differences.  &lt;br /&gt;
:[[File:UMLDiag.jpg|border|]]&lt;br /&gt;
:'''3) Extend the page generation tool with a bunch of additional strategies, such as:'''&lt;br /&gt;
::-Generating elements trees of arbitrary depth&lt;br /&gt;
::-Generating sibling elements&lt;br /&gt;
::-Extending the set of CSS properties that can be generated (display, background, float, padding, margin, border, etc.)&lt;br /&gt;
::-Extending the set of elements that can be generated (span, div, header elements, table (and associated table contents), etc.)&lt;br /&gt;
::-Randomly choose whether to generate a document in quirks mode or not&lt;br /&gt;
&lt;br /&gt;
:For task 3 there are several different parts, but the main goal is to increase the complexity of our randomly generated pages. The code_generation.py file will be adapted to provide these functions. The function used to add random sections will have recursion added to generate elements within elements, resulting in a tree of html elements. The amounting of nesting will be random but limited. Within the sections, tables, lists, spans, and divs may potentially be created. This will involve writing new functions for creating each element, and allowing them to be chosen at random by the function that creates sections of the HTML document. Additionally, the function which provides randomized CSS styling will be extended to generate additional properties.&lt;br /&gt;
&lt;br /&gt;
==Testing==&lt;br /&gt;
Because of the nature of this project, testing the newly added features will be very simple. &lt;br /&gt;
: * For task 1, once we are actually controlling Firefox using geckodriver we will know it is working.  &lt;br /&gt;
: * Task 2 actually involves us comparing screenshots.  By running the code with images that are the same and images that are different, we will be able to test to see if the comparisons work.  &lt;br /&gt;
: * Additionally, we will be able to visually test that task 3 is complete (seeing that the new page generation features work).  While we could probably automate some of the testing for task 2 and 3 (to test all possible scenarios) it is out of the scope of this project.&lt;br /&gt;
&lt;br /&gt;
==Conclusion==&lt;br /&gt;
The previously completed work allows us to generate simple html documents with a randomized structure, render the page in Servo, and take a screenshot of the page. We plan on furthering this work by rendering the pages in both Servo and Firefox, taking screenshots of the pages within both browsers, and reporting differences between the two. Doing so will allow users to evaluate Servo’s ability to load web pages. To make this testing even more informative, we plan to increase the complexity of the structure and styling of the randomly generated html documents.&lt;/div&gt;</summary>
		<author><name>Adsimps3</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2018-_Project_M1803:_Implement_a_web_page_fuzzer_to_find_rendering_mismatches_(Part_2)&amp;diff=117034</id>
		<title>CSC/ECE 517 Spring 2018- Project M1803: Implement a web page fuzzer to find rendering mismatches (Part 2)</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2018-_Project_M1803:_Implement_a_web_page_fuzzer_to_find_rendering_mismatches_(Part_2)&amp;diff=117034"/>
		<updated>2018-04-27T20:37:42Z</updated>

		<summary type="html">&lt;p&gt;Adsimps3: /* Work to be done */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;By Alexander Simpson(adsimps3), Abhay Soni (asoni3), Dileep badveli (dbadvel) and Jake Batty(jbatty)&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
This Mozilla project was broken in to 2 main parts: the previous work and the work to be done.  The previous work was finished as a part of the OSS project.  As a part of the OSS project (explained more below) we created a tool which generates random valid HTML files and automated servo.  [https://en.wikipedia.org/wiki/Servo_(layout_engine) Servo] is experimental web browser developed by Mozilla to &amp;quot;to create a new layout engine using a modern programming language&amp;quot;.  By automating servo (the web browser) we were able to quickly see if servo could render the randomly generated pages.  &lt;br /&gt;
&lt;br /&gt;
The goal of this final project is to complete the &amp;quot;work to be done&amp;quot;.  The work to be done is split into a couple main parts.  First, we are supposed to extend the program created in the OSS project to also control Firefox.  By also controlling Firefox, we can then compare the resulting screenshots (from servo and Firefox) using Python.  Finally, we will expand upon the page generation tool to allow the randomly generated web pages to have more properties/be more complex.&lt;br /&gt;
&lt;br /&gt;
==Previous Work (Part of the OSS Project)==&lt;br /&gt;
&lt;br /&gt;
As per the [https://github.com/servo/servo/wiki/Random-web-content-project project description], we were expected to complete the initial steps. The implementation is explained below for each of these steps.&lt;br /&gt;
&lt;br /&gt;
:1) In a new repository, create a program that can generate a skeleton HTML file with a doctype, head element, and body element, print the result to stdout&lt;br /&gt;
::- Here is the [https://github.com/asoni3/Random-web-content-generator---CSC-517-OSS-Project link] to the repository which contains code_generation.py file which will be used to generate random valid HTML files.&lt;br /&gt;
:2) Add a module to the program that enable generating random content specific to the &amp;lt;head&amp;gt; element (such as inline CSS content inside of a &amp;lt;style&amp;gt; element) and add it to the generated output&lt;br /&gt;
::- The file [https://github.com/asoni3/Random-web-content-generator---CSC-517-OSS-Project/blob/master/code_generation.py code_generation.py], contains the code which generates random content specific to the head element and adds style on top of it. As seen in this code, after generating random content to the file, we will add CSS elements on top of this content. We have established a list of commonly used styles, weights, fonts, font_styles, and alignments which will be used at random. For practical purposes, we are limiting the number of options.&lt;br /&gt;
:3) Add a module to the program that enables generating random content specific to the &amp;lt;body&amp;gt; element (such as a &amp;lt;p&amp;gt; block that contains randomly generated text) and add it to the generated output&lt;br /&gt;
:4) Generate simple random CSS that affects randomly generated content (ie. if there is an element with an id foo, generate a CSS selector like #foo that applies a style like colorto it)&lt;br /&gt;
:5) Create a program under Servo's etc/ that launches Servo and causes it to [https://github.com/servo/servo/wiki/Control-Servo-using-WebDriver take a screenshot] of a particular URL - use this to take screenshots of pages randomly generated by the previous program&lt;br /&gt;
:Sample Screenshot:&lt;br /&gt;
:[[File:Servoscreenshot.png|border]]&lt;br /&gt;
&lt;br /&gt;
==Work Completed==&lt;br /&gt;
Below is a list of the tasks that were completed as a part of our final project.  Below each task we have described how exactly it was implemented with code examples.   &lt;br /&gt;
 &lt;br /&gt;
:'''1) Extend the program that controls Servo to also control Firefox using geckodriver'''&lt;br /&gt;
:Task 1 is relatively simple.  It just involves downloading geckodriver and running it.  Geckodriver is an open source software engine that allows us to render marked content on a web browser.  It should allow us to take screenshots of a particular URL, just like task 5 in the previous work section, but for Firefox instead.  &lt;br /&gt;
&lt;br /&gt;
:'''2) Compare the resulting screenshots and report the contents of the generated page if the screenshots differ'''&lt;br /&gt;
:This task involves automating Firefox to use geckodriver and the current servo program.  They both will create 2 different screenshots.  If servo and Firefox render it differently, we will report that file and mark the differences.  &lt;br /&gt;
:To actually make the comparisons we will use [https://opencv.org/ OpenCV].  OpenCV will allow us to not only make comparisons but will also mark where the differences in.  To actually do the comparisons we will first convert the images to grayscale and then call compare_ssim().  This will get us a ''score'' and diff ''values''.  The ''score'' variables represents how close the to images are to each other and the ''diff'' variables tells us where the differences are.  If the ''score'' indicates that the images are different we will use the ''diff'' value to findContours() and then draw a rectangle around the differences.  &lt;br /&gt;
:[[File:UMLDiag.jpg|border|]]&lt;br /&gt;
:'''3) Extend the page generation tool with a bunch of additional strategies, such as:'''&lt;br /&gt;
::-Generating elements trees of arbitrary depth&lt;br /&gt;
::-Generating sibling elements&lt;br /&gt;
::-Extending the set of CSS properties that can be generated (display, background, float, padding, margin, border, etc.)&lt;br /&gt;
::-Extending the set of elements that can be generated (span, div, header elements, table (and associated table contents), etc.)&lt;br /&gt;
::-Randomly choose whether to generate a document in quirks mode or not&lt;br /&gt;
&lt;br /&gt;
:For task 3 there are several different parts, but the main goal is to increase the complexity of our randomly generated pages. The code_generation.py file will be adapted to provide these functions. The function used to add random sections will have recursion added to generate elements within elements, resulting in a tree of html elements. The amounting of nesting will be random but limited. Within the sections, tables, lists, spans, and divs may potentially be created. This will involve writing new functions for creating each element, and allowing them to be chosen at random by the function that creates sections of the HTML document. Additionally, the function which provides randomized CSS styling will be extended to generate additional properties.&lt;br /&gt;
&lt;br /&gt;
==Testing==&lt;br /&gt;
Because of the nature of this project, testing the newly added features will be very simple. &lt;br /&gt;
: * For task 1, once we are actually controlling Firefox using geckodriver we will know it is working.  &lt;br /&gt;
: * Task 2 actually involves us comparing screenshots.  By running the code with images that are the same and images that are different, we will be able to test to see if the comparisons work.  &lt;br /&gt;
: * Additionally, we will be able to visually test that task 3 is complete (seeing that the new page generation features work).  While we could probably automate some of the testing for task 2 and 3 (to test all possible scenarios) it is out of the scope of this project.&lt;br /&gt;
&lt;br /&gt;
==Conclusion==&lt;br /&gt;
The previously completed work allows us to generate simple html documents with a randomized structure, render the page in Servo, and take a screenshot of the page. We plan on furthering this work by rendering the pages in both Servo and Firefox, taking screenshots of the pages within both browsers, and reporting differences between the two. Doing so will allow users to evaluate Servo’s ability to load web pages. To make this testing even more informative, we plan to increase the complexity of the structure and styling of the randomly generated html documents.&lt;/div&gt;</summary>
		<author><name>Adsimps3</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2018-_Project_M1803:_Implement_a_web_page_fuzzer_to_find_rendering_mismatches_(Part_2)&amp;diff=116703</id>
		<title>CSC/ECE 517 Spring 2018- Project M1803: Implement a web page fuzzer to find rendering mismatches (Part 2)</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2018-_Project_M1803:_Implement_a_web_page_fuzzer_to_find_rendering_mismatches_(Part_2)&amp;diff=116703"/>
		<updated>2018-04-15T20:50:35Z</updated>

		<summary type="html">&lt;p&gt;Adsimps3: /* Work to be done */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;By Alexander Simpson(adsimps3), Abhay Soni (asoni3), Dileep badveli (dbadvel) and Jake Batty(jbatty)&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
This Mozilla project was broken in to 2 main parts: the previous work and the work to be done.  The previous work was finished as a part of the OSS project.  As a part of the OSS project (explained more below) we created a tool which generates random valid HTML files and automated servo.  [https://en.wikipedia.org/wiki/Servo_(layout_engine) Servo] is experimental web browser developed by Mozilla to &amp;quot;to create a new layout engine using a modern programming language&amp;quot;.  By automating servo (the web browser) we were able to quickly see if servo could render the randomly generated pages.  &lt;br /&gt;
&lt;br /&gt;
The goal of this final project is to complete the &amp;quot;work to be done&amp;quot;.  The work to be done is split into a couple main parts.  First, we are supposed to extend the program created in the OSS project to also control Firefox.  By also controlling Firefox, we can then compare the resulting screenshots (from servo and Firefox) using Python.  Finally, we will expand upon the page generation tool to allow the randomly generated web pages to have more properties/be more complex.&lt;br /&gt;
&lt;br /&gt;
==Previous Work (Part of the OSS Project)==&lt;br /&gt;
&lt;br /&gt;
As per the [https://github.com/servo/servo/wiki/Random-web-content-project project description], we were expected to complete the initial steps. The implementation is explained below for each of these steps.&lt;br /&gt;
&lt;br /&gt;
:1) In a new repository, create a program that can generate a skeleton HTML file with a doctype, head element, and body element, print the result to stdout&lt;br /&gt;
::- Here is the [https://github.com/asoni3/Random-web-content-generator---CSC-517-OSS-Project link] to the repository which contains code_generation.py file which will be used to generate random valid HTML files.&lt;br /&gt;
:2) Add a module to the program that enable generating random content specific to the &amp;lt;head&amp;gt; element (such as inline CSS content inside of a &amp;lt;style&amp;gt; element) and add it to the generated output&lt;br /&gt;
::- The file [https://github.com/asoni3/Random-web-content-generator---CSC-517-OSS-Project/blob/master/code_generation.py code_generation.py], contains the code which generates random content specific to the head element and adds style on top of it. As seen in this code, after generating random content to the file, we will add CSS elements on top of this content. We have established a list of commonly used styles, weights, fonts, font_styles, and alignments which will be used at random. For practical purposes, we are limiting the number of options.&lt;br /&gt;
:3) Add a module to the program that enables generating random content specific to the &amp;lt;body&amp;gt; element (such as a &amp;lt;p&amp;gt; block that contains randomly generated text) and add it to the generated output&lt;br /&gt;
:4) Generate simple random CSS that affects randomly generated content (ie. if there is an element with an id foo, generate a CSS selector like #foo that applies a style like colorto it)&lt;br /&gt;
:5) Create a program under Servo's etc/ that launches Servo and causes it to [https://github.com/servo/servo/wiki/Control-Servo-using-WebDriver take a screenshot] of a particular URL - use this to take screenshots of pages randomly generated by the previous program&lt;br /&gt;
:Sample Screenshot:&lt;br /&gt;
:[[File:Servoscreenshot.png|border]]&lt;br /&gt;
&lt;br /&gt;
==Work to be done==&lt;br /&gt;
Below is a list of the tasks to be done as a part of our final project.  Below each task we have described what we think it will take to complete the respective task.  &lt;br /&gt;
 &lt;br /&gt;
:'''1) Extend the program that controls Servo to also control Firefox using geckodriver'''&lt;br /&gt;
:Task 1 is relatively simple.  It just involves downloading geckodriver and running it.  Geckodriver is an open source software engine that allows us to render marked content on a web browser.  It should allow us to take screenshots of a particular URL, just like task 5 in the previous work section, but for Firefox instead.  &lt;br /&gt;
&lt;br /&gt;
:'''2) Compare the resulting screenshots and report the contents of the generated page if the screenshots differ'''&lt;br /&gt;
:This task involves automating Firefox to use geckodriver and the current servo program.  They both will create 2 different screenshots.  If servo and Firefox render it differently, we will report that file and mark the differences.  &lt;br /&gt;
:To actually make the comparisons we will use [https://opencv.org/ OpenCV].  OpenCV will allow us to not only make comparisons but will also mark where the differences in.  To actually do the comparisons we will first convert the images to grayscale and then call compare_ssim().  This will get us a ''score'' and diff ''values''.  The ''score'' variables represents how close the to images are to each other and the ''diff'' variables tells us where the differences are.  If the ''score'' indicates that the images are different we will use the ''diff'' value to findContours() and then draw a rectangle around the differences.  &lt;br /&gt;
&lt;br /&gt;
:'''3) Extend the page generation tool with a bunch of additional strategies, such as:'''&lt;br /&gt;
::-Generating elements trees of arbitrary depth&lt;br /&gt;
::-Generating sibling elements&lt;br /&gt;
::-Extending the set of CSS properties that can be generated (display, background, float, padding, margin, border, etc.)&lt;br /&gt;
::-Extending the set of elements that can be generated (span, div, header elements, table (and associated table contents), etc.)&lt;br /&gt;
::-Randomly choose whether to generate a document in quirks mode or not&lt;br /&gt;
:For task 3 there are several different parts, but the main goal is to increase the complexity of our randomly generated pages. The code_generation.py file will be adapted to provide these functions. The function used to add random sections will have recursion added to generate elements within elements, resulting in a tree of html elements. The amounting of nesting will be random but limited. Within the sections, tables, lists, spans, and divs may potentially be created. This will involve writing new functions for creating each element, and allowing them to be chosen at random by the function that creates sections of the HTML document. Additionally, the function which provides randomized CSS styling will be extended to generate additional properties.&lt;br /&gt;
&lt;br /&gt;
==Testing==&lt;br /&gt;
Because of the nature of this project, testing the newly added features will be very simple. For task 1, once we are actually controlling Firefox using geckodriver we will know it is working.  Task 2 actually involves us comparing screenshots.  By running the code with images that are the same and images that are different, we will be able to test to see if the comparisons work.  Additionally, we will be able to visually test that task 3 is complete (seeing that the new page generation features work).  While we could probably automate some of the testing for task 2 and 3 (to test all possible scenarios) it is out of the scope of this project.&lt;br /&gt;
&lt;br /&gt;
==Conclusion==&lt;br /&gt;
The previously completed work allows us to generate simple html documents with a randomized structure, render the page in Servo, and take a screenshot of the page. We plan on furthering this work by rendering the pages in both Servo and Firefox, taking screenshots of the pages within both browsers, and reporting differences between the two. Doing so will allow users to evaluate Servo’s ability to load web pages. To make this testing even more informative, we plan to increase the complexity of the structure and styling of the randomly generated html documents.&lt;/div&gt;</summary>
		<author><name>Adsimps3</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2018-_Project_M1803:_Implement_a_web_page_fuzzer_to_find_rendering_mismatches_(Part_2)&amp;diff=116702</id>
		<title>CSC/ECE 517 Spring 2018- Project M1803: Implement a web page fuzzer to find rendering mismatches (Part 2)</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2018-_Project_M1803:_Implement_a_web_page_fuzzer_to_find_rendering_mismatches_(Part_2)&amp;diff=116702"/>
		<updated>2018-04-15T20:50:09Z</updated>

		<summary type="html">&lt;p&gt;Adsimps3: /* Work to be done */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;By Alexander Simpson(adsimps3), Abhay Soni (asoni3), Dileep badveli (dbadvel) and Jake Batty(jbatty)&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
This Mozilla project was broken in to 2 main parts: the previous work and the work to be done.  The previous work was finished as a part of the OSS project.  As a part of the OSS project (explained more below) we created a tool which generates random valid HTML files and automated servo.  [https://en.wikipedia.org/wiki/Servo_(layout_engine) Servo] is experimental web browser developed by Mozilla to &amp;quot;to create a new layout engine using a modern programming language&amp;quot;.  By automating servo (the web browser) we were able to quickly see if servo could render the randomly generated pages.  &lt;br /&gt;
&lt;br /&gt;
The goal of this final project is to complete the &amp;quot;work to be done&amp;quot;.  The work to be done is split into a couple main parts.  First, we are supposed to extend the program created in the OSS project to also control Firefox.  By also controlling Firefox, we can then compare the resulting screenshots (from servo and Firefox) using Python.  Finally, we will expand upon the page generation tool to allow the randomly generated web pages to have more properties/be more complex.&lt;br /&gt;
&lt;br /&gt;
==Previous Work (Part of the OSS Project)==&lt;br /&gt;
&lt;br /&gt;
As per the [https://github.com/servo/servo/wiki/Random-web-content-project project description], we were expected to complete the initial steps. The implementation is explained below for each of these steps.&lt;br /&gt;
&lt;br /&gt;
:1) In a new repository, create a program that can generate a skeleton HTML file with a doctype, head element, and body element, print the result to stdout&lt;br /&gt;
::- Here is the [https://github.com/asoni3/Random-web-content-generator---CSC-517-OSS-Project link] to the repository which contains code_generation.py file which will be used to generate random valid HTML files.&lt;br /&gt;
:2) Add a module to the program that enable generating random content specific to the &amp;lt;head&amp;gt; element (such as inline CSS content inside of a &amp;lt;style&amp;gt; element) and add it to the generated output&lt;br /&gt;
::- The file [https://github.com/asoni3/Random-web-content-generator---CSC-517-OSS-Project/blob/master/code_generation.py code_generation.py], contains the code which generates random content specific to the head element and adds style on top of it. As seen in this code, after generating random content to the file, we will add CSS elements on top of this content. We have established a list of commonly used styles, weights, fonts, font_styles, and alignments which will be used at random. For practical purposes, we are limiting the number of options.&lt;br /&gt;
:3) Add a module to the program that enables generating random content specific to the &amp;lt;body&amp;gt; element (such as a &amp;lt;p&amp;gt; block that contains randomly generated text) and add it to the generated output&lt;br /&gt;
:4) Generate simple random CSS that affects randomly generated content (ie. if there is an element with an id foo, generate a CSS selector like #foo that applies a style like colorto it)&lt;br /&gt;
:5) Create a program under Servo's etc/ that launches Servo and causes it to [https://github.com/servo/servo/wiki/Control-Servo-using-WebDriver take a screenshot] of a particular URL - use this to take screenshots of pages randomly generated by the previous program&lt;br /&gt;
:Sample Screenshot:&lt;br /&gt;
:[[File:Servoscreenshot.png|border]]&lt;br /&gt;
&lt;br /&gt;
==Work to be done==&lt;br /&gt;
Below is a list of the tasks to be done as a part of our final project.  Below each task we have described what we think it will take to complete the respective task.  &lt;br /&gt;
 &lt;br /&gt;
:'''1) Extend the program that controls Servo to also control Firefox using geckodriver'''&lt;br /&gt;
:Task 1 is relatively simple.  It just involves downloading geckodriver and running it.  Geckodriver is an open source software engine that allows us to render marked content on a web browser.  It should allow us to take screenshots of a particular URL just like task 5 in the previous work section, but for Firefox instead.  &lt;br /&gt;
&lt;br /&gt;
:'''2) Compare the resulting screenshots and report the contents of the generated page if the screenshots differ'''&lt;br /&gt;
:This task involves automating Firefox to use geckodriver and the current servo program.  They both will create 2 different screenshots.  If servo and Firefox render it differently, we will report that file and mark the differences.  &lt;br /&gt;
:To actually make the comparisons we will use [https://opencv.org/ OpenCV].  OpenCV will allow us to not only make comparisons but will also mark where the differences in.  To actually do the comparisons we will first convert the images to grayscale and then call compare_ssim().  This will get us a ''score'' and diff ''values''.  The ''score'' variables represents how close the to images are to each other and the ''diff'' variables tells us where the differences are.  If the ''score'' indicates that the images are different we will use the ''diff'' value to findContours() and then draw a rectangle around the differences.  &lt;br /&gt;
&lt;br /&gt;
:'''3) Extend the page generation tool with a bunch of additional strategies, such as:'''&lt;br /&gt;
::-Generating elements trees of arbitrary depth&lt;br /&gt;
::-Generating sibling elements&lt;br /&gt;
::-Extending the set of CSS properties that can be generated (display, background, float, padding, margin, border, etc.)&lt;br /&gt;
::-Extending the set of elements that can be generated (span, div, header elements, table (and associated table contents), etc.)&lt;br /&gt;
::-Randomly choose whether to generate a document in quirks mode or not&lt;br /&gt;
:For task 3 there are several different parts, but the main goal is to increase the complexity of our randomly generated pages. The code_generation.py file will be adapted to provide these functions. The function used to add random sections will have recursion added to generate elements within elements, resulting in a tree of html elements. The amounting of nesting will be random but limited. Within the sections, tables, lists, spans, and divs may potentially be created. This will involve writing new functions for creating each element, and allowing them to be chosen at random by the function that creates sections of the HTML document. Additionally, the function which provides randomized CSS styling will be extended to generate additional properties.&lt;br /&gt;
&lt;br /&gt;
==Testing==&lt;br /&gt;
Because of the nature of this project, testing the newly added features will be very simple. For task 1, once we are actually controlling Firefox using geckodriver we will know it is working.  Task 2 actually involves us comparing screenshots.  By running the code with images that are the same and images that are different, we will be able to test to see if the comparisons work.  Additionally, we will be able to visually test that task 3 is complete (seeing that the new page generation features work).  While we could probably automate some of the testing for task 2 and 3 (to test all possible scenarios) it is out of the scope of this project.&lt;br /&gt;
&lt;br /&gt;
==Conclusion==&lt;br /&gt;
The previously completed work allows us to generate simple html documents with a randomized structure, render the page in Servo, and take a screenshot of the page. We plan on furthering this work by rendering the pages in both Servo and Firefox, taking screenshots of the pages within both browsers, and reporting differences between the two. Doing so will allow users to evaluate Servo’s ability to load web pages. To make this testing even more informative, we plan to increase the complexity of the structure and styling of the randomly generated html documents.&lt;/div&gt;</summary>
		<author><name>Adsimps3</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2018-_Project_M1803:_Implement_a_web_page_fuzzer_to_find_rendering_mismatches_(Part_2)&amp;diff=116701</id>
		<title>CSC/ECE 517 Spring 2018- Project M1803: Implement a web page fuzzer to find rendering mismatches (Part 2)</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2018-_Project_M1803:_Implement_a_web_page_fuzzer_to_find_rendering_mismatches_(Part_2)&amp;diff=116701"/>
		<updated>2018-04-15T20:48:39Z</updated>

		<summary type="html">&lt;p&gt;Adsimps3: /* Introduction */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;By Alexander Simpson(adsimps3), Abhay Soni (asoni3), Dileep badveli (dbadvel) and Jake Batty(jbatty)&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
This Mozilla project was broken in to 2 main parts: the previous work and the work to be done.  The previous work was finished as a part of the OSS project.  As a part of the OSS project (explained more below) we created a tool which generates random valid HTML files and automated servo.  [https://en.wikipedia.org/wiki/Servo_(layout_engine) Servo] is experimental web browser developed by Mozilla to &amp;quot;to create a new layout engine using a modern programming language&amp;quot;.  By automating servo (the web browser) we were able to quickly see if servo could render the randomly generated pages.  &lt;br /&gt;
&lt;br /&gt;
The goal of this final project is to complete the &amp;quot;work to be done&amp;quot;.  The work to be done is split into a couple main parts.  First, we are supposed to extend the program created in the OSS project to also control Firefox.  By also controlling Firefox, we can then compare the resulting screenshots (from servo and Firefox) using Python.  Finally, we will expand upon the page generation tool to allow the randomly generated web pages to have more properties/be more complex.&lt;br /&gt;
&lt;br /&gt;
==Previous Work (Part of the OSS Project)==&lt;br /&gt;
&lt;br /&gt;
As per the [https://github.com/servo/servo/wiki/Random-web-content-project project description], we were expected to complete the initial steps. The implementation is explained below for each of these steps.&lt;br /&gt;
&lt;br /&gt;
:1) In a new repository, create a program that can generate a skeleton HTML file with a doctype, head element, and body element, print the result to stdout&lt;br /&gt;
::- Here is the [https://github.com/asoni3/Random-web-content-generator---CSC-517-OSS-Project link] to the repository which contains code_generation.py file which will be used to generate random valid HTML files.&lt;br /&gt;
:2) Add a module to the program that enable generating random content specific to the &amp;lt;head&amp;gt; element (such as inline CSS content inside of a &amp;lt;style&amp;gt; element) and add it to the generated output&lt;br /&gt;
::- The file [https://github.com/asoni3/Random-web-content-generator---CSC-517-OSS-Project/blob/master/code_generation.py code_generation.py], contains the code which generates random content specific to the head element and adds style on top of it. As seen in this code, after generating random content to the file, we will add CSS elements on top of this content. We have established a list of commonly used styles, weights, fonts, font_styles, and alignments which will be used at random. For practical purposes, we are limiting the number of options.&lt;br /&gt;
:3) Add a module to the program that enables generating random content specific to the &amp;lt;body&amp;gt; element (such as a &amp;lt;p&amp;gt; block that contains randomly generated text) and add it to the generated output&lt;br /&gt;
:4) Generate simple random CSS that affects randomly generated content (ie. if there is an element with an id foo, generate a CSS selector like #foo that applies a style like colorto it)&lt;br /&gt;
:5) Create a program under Servo's etc/ that launches Servo and causes it to [https://github.com/servo/servo/wiki/Control-Servo-using-WebDriver take a screenshot] of a particular URL - use this to take screenshots of pages randomly generated by the previous program&lt;br /&gt;
:Sample Screenshot:&lt;br /&gt;
:[[File:Servoscreenshot.png|border]]&lt;br /&gt;
&lt;br /&gt;
==Work to be done==&lt;br /&gt;
Below is a list of the tasks to be done as a part of our final project.  Below each task we have described what we think it will take to complete the respective task.  &lt;br /&gt;
 &lt;br /&gt;
:'''1) Extend the program that controls Servo to also control Firefox using geckodriver'''&lt;br /&gt;
:Task 1 is relatively simple.  It just involves downloading geckodriver and running it.  Geckodriver is an open source software engine that allows us to render marked content on a web browser.  It should allow us to take screenshots of a particular URL just like task 5 in the previous work section.  &lt;br /&gt;
&lt;br /&gt;
:'''2) Compare the resulting screenshots and report the contents of the generated page if the screenshots differ'''&lt;br /&gt;
:This task involves automating Firefox to use geckodriver and the current servo program.  They both will create 2 different screenshots.  If servo and Firefox render it differently, we will report that file and mark the differences.  &lt;br /&gt;
:To actually make the comparisons we will use [https://opencv.org/ OpenCV].  OpenCV will allow us to not only make comparisons but will also mark where the differences in.  To actually do the comparisons we will first convert the images to grayscale and then call compare_ssim().  This will get us a ''score'' and diff ''values''.  The ''score'' variables represents how close the to images are to each other and the ''diff'' variables tells us where the differences are.  If the ''score'' indicates that the images are different we will use the ''diff'' value to findContours() and then draw a rectangle around the differences.  &lt;br /&gt;
&lt;br /&gt;
:'''3) Extend the page generation tool with a bunch of additional strategies, such as:'''&lt;br /&gt;
::-Generating elements trees of arbitrary depth&lt;br /&gt;
::-Generating sibling elements&lt;br /&gt;
::-Extending the set of CSS properties that can be generated (display, background, float, padding, margin, border, etc.)&lt;br /&gt;
::-Extending the set of elements that can be generated (span, div, header elements, table (and associated table contents), etc.)&lt;br /&gt;
::-Randomly choose whether to generate a document in quirks mode or not&lt;br /&gt;
:For task 3 there are several different parts, but the main goal is to increase the complexity of our randomly generated pages. The code_generation.py file will be adapted to provide these functions. The function used to add random sections will have recursion added to generate elements within elements, resulting in a tree of html elements. The amounting of nesting will be random but limited. Within the sections, tables, lists, spans, and divs may potentially be created. This will involve writing new functions for creating each element, and allowing them to be chosen at random by the function that creates sections of the HTML document. Additionally, the function which provides randomized CSS styling will be extended to generate additional properties.&lt;br /&gt;
&lt;br /&gt;
==Testing==&lt;br /&gt;
Because of the nature of this project, testing the newly added features will be very simple. For task 1, once we are actually controlling Firefox using geckodriver we will know it is working.  Task 2 actually involves us comparing screenshots.  By running the code with images that are the same and images that are different, we will be able to test to see if the comparisons work.  Additionally, we will be able to visually test that task 3 is complete (seeing that the new page generation features work).  While we could probably automate some of the testing for task 2 and 3 (to test all possible scenarios) it is out of the scope of this project.&lt;br /&gt;
&lt;br /&gt;
==Conclusion==&lt;br /&gt;
The previously completed work allows us to generate simple html documents with a randomized structure, render the page in Servo, and take a screenshot of the page. We plan on furthering this work by rendering the pages in both Servo and Firefox, taking screenshots of the pages within both browsers, and reporting differences between the two. Doing so will allow users to evaluate Servo’s ability to load web pages. To make this testing even more informative, we plan to increase the complexity of the structure and styling of the randomly generated html documents.&lt;/div&gt;</summary>
		<author><name>Adsimps3</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2018-_Project_M1803:_Implement_a_web_page_fuzzer_to_find_rendering_mismatches_(Part_2)&amp;diff=116700</id>
		<title>CSC/ECE 517 Spring 2018- Project M1803: Implement a web page fuzzer to find rendering mismatches (Part 2)</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2018-_Project_M1803:_Implement_a_web_page_fuzzer_to_find_rendering_mismatches_(Part_2)&amp;diff=116700"/>
		<updated>2018-04-15T20:48:02Z</updated>

		<summary type="html">&lt;p&gt;Adsimps3: /* Introduction */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;By Alexander Simpson(adsimps3), Abhay Soni (asoni3), Dileep badveli (dbadvel) and Jake Batty(jbatty)&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
This Mozilla project was broken in to 2 main parts: the previous work and the work to be done.  The previous work was finished as a part of the OSS project.  As a part of the OSS project (explained more below) we created a tool which generates random valid HTML files and automated servo.  [https://en.wikipedia.org/wiki/Servo_(layout_engine) Servo] is experimental web browser developed by Mozilla to &amp;quot;to create a new layout engine using a modern programming language&amp;quot;.  By automating servo (the web browser) we were able to quickly see if servo could render the randomly generated pages.  &lt;br /&gt;
&lt;br /&gt;
The goal of this final project is to complete the &amp;quot;work to be done&amp;quot;.  The work to be done is split into a couple main parts.  First, we are supposed to extend the program created in the OSS project to also control Firefox.  By also controlling Firefox, we can then compare the resulting screenshots (from servo and Firefox) using Python.  Finally, we will expand upon the page generation tool to allow the randomly generated web pages to have more properties/be more unique.&lt;br /&gt;
&lt;br /&gt;
==Previous Work (Part of the OSS Project)==&lt;br /&gt;
&lt;br /&gt;
As per the [https://github.com/servo/servo/wiki/Random-web-content-project project description], we were expected to complete the initial steps. The implementation is explained below for each of these steps.&lt;br /&gt;
&lt;br /&gt;
:1) In a new repository, create a program that can generate a skeleton HTML file with a doctype, head element, and body element, print the result to stdout&lt;br /&gt;
::- Here is the [https://github.com/asoni3/Random-web-content-generator---CSC-517-OSS-Project link] to the repository which contains code_generation.py file which will be used to generate random valid HTML files.&lt;br /&gt;
:2) Add a module to the program that enable generating random content specific to the &amp;lt;head&amp;gt; element (such as inline CSS content inside of a &amp;lt;style&amp;gt; element) and add it to the generated output&lt;br /&gt;
::- The file [https://github.com/asoni3/Random-web-content-generator---CSC-517-OSS-Project/blob/master/code_generation.py code_generation.py], contains the code which generates random content specific to the head element and adds style on top of it. As seen in this code, after generating random content to the file, we will add CSS elements on top of this content. We have established a list of commonly used styles, weights, fonts, font_styles, and alignments which will be used at random. For practical purposes, we are limiting the number of options.&lt;br /&gt;
:3) Add a module to the program that enables generating random content specific to the &amp;lt;body&amp;gt; element (such as a &amp;lt;p&amp;gt; block that contains randomly generated text) and add it to the generated output&lt;br /&gt;
:4) Generate simple random CSS that affects randomly generated content (ie. if there is an element with an id foo, generate a CSS selector like #foo that applies a style like colorto it)&lt;br /&gt;
:5) Create a program under Servo's etc/ that launches Servo and causes it to [https://github.com/servo/servo/wiki/Control-Servo-using-WebDriver take a screenshot] of a particular URL - use this to take screenshots of pages randomly generated by the previous program&lt;br /&gt;
:Sample Screenshot:&lt;br /&gt;
:[[File:Servoscreenshot.png|border]]&lt;br /&gt;
&lt;br /&gt;
==Work to be done==&lt;br /&gt;
Below is a list of the tasks to be done as a part of our final project.  Below each task we have described what we think it will take to complete the respective task.  &lt;br /&gt;
 &lt;br /&gt;
:'''1) Extend the program that controls Servo to also control Firefox using geckodriver'''&lt;br /&gt;
:Task 1 is relatively simple.  It just involves downloading geckodriver and running it.  Geckodriver is an open source software engine that allows us to render marked content on a web browser.  It should allow us to take screenshots of a particular URL just like task 5 in the previous work section.  &lt;br /&gt;
&lt;br /&gt;
:'''2) Compare the resulting screenshots and report the contents of the generated page if the screenshots differ'''&lt;br /&gt;
:This task involves automating Firefox to use geckodriver and the current servo program.  They both will create 2 different screenshots.  If servo and Firefox render it differently, we will report that file and mark the differences.  &lt;br /&gt;
:To actually make the comparisons we will use [https://opencv.org/ OpenCV].  OpenCV will allow us to not only make comparisons but will also mark where the differences in.  To actually do the comparisons we will first convert the images to grayscale and then call compare_ssim().  This will get us a ''score'' and diff ''values''.  The ''score'' variables represents how close the to images are to each other and the ''diff'' variables tells us where the differences are.  If the ''score'' indicates that the images are different we will use the ''diff'' value to findContours() and then draw a rectangle around the differences.  &lt;br /&gt;
&lt;br /&gt;
:'''3) Extend the page generation tool with a bunch of additional strategies, such as:'''&lt;br /&gt;
::-Generating elements trees of arbitrary depth&lt;br /&gt;
::-Generating sibling elements&lt;br /&gt;
::-Extending the set of CSS properties that can be generated (display, background, float, padding, margin, border, etc.)&lt;br /&gt;
::-Extending the set of elements that can be generated (span, div, header elements, table (and associated table contents), etc.)&lt;br /&gt;
::-Randomly choose whether to generate a document in quirks mode or not&lt;br /&gt;
:For task 3 there are several different parts, but the main goal is to increase the complexity of our randomly generated pages. The code_generation.py file will be adapted to provide these functions. The function used to add random sections will have recursion added to generate elements within elements, resulting in a tree of html elements. The amounting of nesting will be random but limited. Within the sections, tables, lists, spans, and divs may potentially be created. This will involve writing new functions for creating each element, and allowing them to be chosen at random by the function that creates sections of the HTML document. Additionally, the function which provides randomized CSS styling will be extended to generate additional properties.&lt;br /&gt;
&lt;br /&gt;
==Testing==&lt;br /&gt;
Because of the nature of this project, testing the newly added features will be very simple. For task 1, once we are actually controlling Firefox using geckodriver we will know it is working.  Task 2 actually involves us comparing screenshots.  By running the code with images that are the same and images that are different, we will be able to test to see if the comparisons work.  Additionally, we will be able to visually test that task 3 is complete (seeing that the new page generation features work).  While we could probably automate some of the testing for task 2 and 3 (to test all possible scenarios) it is out of the scope of this project.&lt;br /&gt;
&lt;br /&gt;
==Conclusion==&lt;br /&gt;
The previously completed work allows us to generate simple html documents with a randomized structure, render the page in Servo, and take a screenshot of the page. We plan on furthering this work by rendering the pages in both Servo and Firefox, taking screenshots of the pages within both browsers, and reporting differences between the two. Doing so will allow users to evaluate Servo’s ability to load web pages. To make this testing even more informative, we plan to increase the complexity of the structure and styling of the randomly generated html documents.&lt;/div&gt;</summary>
		<author><name>Adsimps3</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2018-_Project_M1803:_Implement_a_web_page_fuzzer_to_find_rendering_mismatches_(Part_2)&amp;diff=116699</id>
		<title>CSC/ECE 517 Spring 2018- Project M1803: Implement a web page fuzzer to find rendering mismatches (Part 2)</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2018-_Project_M1803:_Implement_a_web_page_fuzzer_to_find_rendering_mismatches_(Part_2)&amp;diff=116699"/>
		<updated>2018-04-15T20:42:57Z</updated>

		<summary type="html">&lt;p&gt;Adsimps3: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;By Alexander Simpson(adsimps3), Abhay Soni (asoni3), Dileep badveli (dbadvel) and Jake Batty(jbatty)&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
This Mozilla project was broken in to 2 main parts: the previous work and the work to be done.  The previous work was finished as a part of the OSS project.  The goal of this final project is to complete the work to be done.  As a part of the OSS project (explained more below) we created a tool which generates random valid HTML files and automated servo.  [https://en.wikipedia.org/wiki/Servo_(layout_engine) Servo] is research project developed by Mozilla to &amp;quot;to create a new layout engine using a modern programming language&amp;quot;.  By automating servo we were able to quickly see if servo could render the randomly generated pages.  Now, as a part of this project we are supposed to extend the program to also control Firefox, compare the resulting screenshots (from servo and Firefox), and finally expand upon the page generation tool.&lt;br /&gt;
&lt;br /&gt;
==Previous Work (Part of the OSS Project)==&lt;br /&gt;
&lt;br /&gt;
As per the [https://github.com/servo/servo/wiki/Random-web-content-project project description], we were expected to complete the initial steps. The implementation is explained below for each of these steps.&lt;br /&gt;
&lt;br /&gt;
:1) In a new repository, create a program that can generate a skeleton HTML file with a doctype, head element, and body element, print the result to stdout&lt;br /&gt;
::- Here is the [https://github.com/asoni3/Random-web-content-generator---CSC-517-OSS-Project link] to the repository which contains code_generation.py file which will be used to generate random valid HTML files.&lt;br /&gt;
:2) Add a module to the program that enable generating random content specific to the &amp;lt;head&amp;gt; element (such as inline CSS content inside of a &amp;lt;style&amp;gt; element) and add it to the generated output&lt;br /&gt;
::- The file [https://github.com/asoni3/Random-web-content-generator---CSC-517-OSS-Project/blob/master/code_generation.py code_generation.py], contains the code which generates random content specific to the head element and adds style on top of it. As seen in this code, after generating random content to the file, we will add CSS elements on top of this content. We have established a list of commonly used styles, weights, fonts, font_styles, and alignments which will be used at random. For practical purposes, we are limiting the number of options.&lt;br /&gt;
:3) Add a module to the program that enables generating random content specific to the &amp;lt;body&amp;gt; element (such as a &amp;lt;p&amp;gt; block that contains randomly generated text) and add it to the generated output&lt;br /&gt;
:4) Generate simple random CSS that affects randomly generated content (ie. if there is an element with an id foo, generate a CSS selector like #foo that applies a style like colorto it)&lt;br /&gt;
:5) Create a program under Servo's etc/ that launches Servo and causes it to [https://github.com/servo/servo/wiki/Control-Servo-using-WebDriver take a screenshot] of a particular URL - use this to take screenshots of pages randomly generated by the previous program&lt;br /&gt;
:Sample Screenshot:&lt;br /&gt;
:[[File:Servoscreenshot.png|border]]&lt;br /&gt;
&lt;br /&gt;
==Work to be done==&lt;br /&gt;
Below is a list of the tasks to be done as a part of our final project.  Below each task we have described what we think it will take to complete the respective task.  &lt;br /&gt;
 &lt;br /&gt;
:'''1) Extend the program that controls Servo to also control Firefox using geckodriver'''&lt;br /&gt;
:Task 1 is relatively simple.  It just involves downloading geckodriver and running it.  Geckodriver is an open source software engine that allows us to render marked content on a web browser.  It should allow us to take screenshots of a particular URL just like task 5 in the previous work section.  &lt;br /&gt;
&lt;br /&gt;
:'''2) Compare the resulting screenshots and report the contents of the generated page if the screenshots differ'''&lt;br /&gt;
:This task involves automating Firefox to use geckodriver and the current servo program.  They both will create 2 different screenshots.  If servo and Firefox render it differently, we will report that file and mark the differences.  &lt;br /&gt;
:To actually make the comparisons we will use [https://opencv.org/ OpenCV].  OpenCV will allow us to not only make comparisons but will also mark where the differences in.  To actually do the comparisons we will first convert the images to grayscale and then call compare_ssim().  This will get us a ''score'' and diff ''values''.  The ''score'' variables represents how close the to images are to each other and the ''diff'' variables tells us where the differences are.  If the ''score'' indicates that the images are different we will use the ''diff'' value to findContours() and then draw a rectangle around the differences.  &lt;br /&gt;
&lt;br /&gt;
:'''3) Extend the page generation tool with a bunch of additional strategies, such as:'''&lt;br /&gt;
::-Generating elements trees of arbitrary depth&lt;br /&gt;
::-Generating sibling elements&lt;br /&gt;
::-Extending the set of CSS properties that can be generated (display, background, float, padding, margin, border, etc.)&lt;br /&gt;
::-Extending the set of elements that can be generated (span, div, header elements, table (and associated table contents), etc.)&lt;br /&gt;
::-Randomly choose whether to generate a document in quirks mode or not&lt;br /&gt;
:For task 3 there are several different parts, but the main goal is to increase the complexity of our randomly generated pages. The code_generation.py file will be adapted to provide these functions. The function used to add random sections will have recursion added to generate elements within elements, resulting in a tree of html elements. The amounting of nesting will be random but limited. Within the sections, tables, lists, spans, and divs may potentially be created. This will involve writing new functions for creating each element, and allowing them to be chosen at random by the function that creates sections of the HTML document. Additionally, the function which provides randomized CSS styling will be extended to generate additional properties.&lt;br /&gt;
&lt;br /&gt;
==Testing==&lt;br /&gt;
Because of the nature of this project, testing the newly added features will be very simple. For task 1, once we are actually controlling Firefox using geckodriver we will know it is working.  Task 2 actually involves us comparing screenshots.  By running the code with images that are the same and images that are different, we will be able to test to see if the comparisons work.  Additionally, we will be able to visually test that task 3 is complete (seeing that the new page generation features work).  While we could probably automate some of the testing for task 2 and 3 (to test all possible scenarios) it is out of the scope of this project.&lt;br /&gt;
&lt;br /&gt;
==Conclusion==&lt;br /&gt;
The previously completed work allows us to generate simple html documents with a randomized structure, render the page in Servo, and take a screenshot of the page. We plan on furthering this work by rendering the pages in both Servo and Firefox, taking screenshots of the pages within both browsers, and reporting differences between the two. Doing so will allow users to evaluate Servo’s ability to load web pages. To make this testing even more informative, we plan to increase the complexity of the structure and styling of the randomly generated html documents.&lt;/div&gt;</summary>
		<author><name>Adsimps3</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2018-_Project_M1803:_Implement_a_web_page_fuzzer_to_find_rendering_mismatches_(Part_2)&amp;diff=116698</id>
		<title>CSC/ECE 517 Spring 2018- Project M1803: Implement a web page fuzzer to find rendering mismatches (Part 2)</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2018-_Project_M1803:_Implement_a_web_page_fuzzer_to_find_rendering_mismatches_(Part_2)&amp;diff=116698"/>
		<updated>2018-04-15T20:42:42Z</updated>

		<summary type="html">&lt;p&gt;Adsimps3: /* Introduction */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;By Alexander Simpson(adsimps3), Abhay Soni (asoni3), Dileep badveli (dbadvel) and Jake Batty(jbatty)&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
This Mozilla project was broken in to 2 main parts: the previous work and the work to be done.  The previous work was finished as a part of the OSS project.  The goal of this final project is to complete the work to be done.  As a part of the OSS project (explained more below) we created a tool which generates random valid HTML files and automated servo.  [https://en.wikipedia.org/wiki/Servo_(layout_engine) Servo] is research project developed by Mozilla to &amp;quot;to create a new layout engine using a modern programming language&amp;quot;.  By automating servo we were able to quickly see if servo could render the randomly generated pages.  Now, as a part of this project we are supposed to extend the program to also control Firefox, compare the resulting screenshots (from servo and Firefox), and finally expand upon the page generation tool.&lt;br /&gt;
&lt;br /&gt;
==Background==&lt;br /&gt;
[https://en.wikipedia.org/wiki/Servo_(layout_engine) Servo] is research project developed by Mozilla to &amp;quot;to create a new layout engine using a modern programming language&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
==Previous Work (Part of the OSS Project)==&lt;br /&gt;
&lt;br /&gt;
As per the [https://github.com/servo/servo/wiki/Random-web-content-project project description], we were expected to complete the initial steps. The implementation is explained below for each of these steps.&lt;br /&gt;
&lt;br /&gt;
:1) In a new repository, create a program that can generate a skeleton HTML file with a doctype, head element, and body element, print the result to stdout&lt;br /&gt;
::- Here is the [https://github.com/asoni3/Random-web-content-generator---CSC-517-OSS-Project link] to the repository which contains code_generation.py file which will be used to generate random valid HTML files.&lt;br /&gt;
:2) Add a module to the program that enable generating random content specific to the &amp;lt;head&amp;gt; element (such as inline CSS content inside of a &amp;lt;style&amp;gt; element) and add it to the generated output&lt;br /&gt;
::- The file [https://github.com/asoni3/Random-web-content-generator---CSC-517-OSS-Project/blob/master/code_generation.py code_generation.py], contains the code which generates random content specific to the head element and adds style on top of it. As seen in this code, after generating random content to the file, we will add CSS elements on top of this content. We have established a list of commonly used styles, weights, fonts, font_styles, and alignments which will be used at random. For practical purposes, we are limiting the number of options.&lt;br /&gt;
:3) Add a module to the program that enables generating random content specific to the &amp;lt;body&amp;gt; element (such as a &amp;lt;p&amp;gt; block that contains randomly generated text) and add it to the generated output&lt;br /&gt;
:4) Generate simple random CSS that affects randomly generated content (ie. if there is an element with an id foo, generate a CSS selector like #foo that applies a style like colorto it)&lt;br /&gt;
:5) Create a program under Servo's etc/ that launches Servo and causes it to [https://github.com/servo/servo/wiki/Control-Servo-using-WebDriver take a screenshot] of a particular URL - use this to take screenshots of pages randomly generated by the previous program&lt;br /&gt;
:Sample Screenshot:&lt;br /&gt;
:[[File:Servoscreenshot.png|border]]&lt;br /&gt;
&lt;br /&gt;
==Work to be done==&lt;br /&gt;
Below is a list of the tasks to be done as a part of our final project.  Below each task we have described what we think it will take to complete the respective task.  &lt;br /&gt;
 &lt;br /&gt;
:'''1) Extend the program that controls Servo to also control Firefox using geckodriver'''&lt;br /&gt;
:Task 1 is relatively simple.  It just involves downloading geckodriver and running it.  Geckodriver is an open source software engine that allows us to render marked content on a web browser.  It should allow us to take screenshots of a particular URL just like task 5 in the previous work section.  &lt;br /&gt;
&lt;br /&gt;
:'''2) Compare the resulting screenshots and report the contents of the generated page if the screenshots differ'''&lt;br /&gt;
:This task involves automating Firefox to use geckodriver and the current servo program.  They both will create 2 different screenshots.  If servo and Firefox render it differently, we will report that file and mark the differences.  &lt;br /&gt;
:To actually make the comparisons we will use [https://opencv.org/ OpenCV].  OpenCV will allow us to not only make comparisons but will also mark where the differences in.  To actually do the comparisons we will first convert the images to grayscale and then call compare_ssim().  This will get us a ''score'' and diff ''values''.  The ''score'' variables represents how close the to images are to each other and the ''diff'' variables tells us where the differences are.  If the ''score'' indicates that the images are different we will use the ''diff'' value to findContours() and then draw a rectangle around the differences.  &lt;br /&gt;
&lt;br /&gt;
:'''3) Extend the page generation tool with a bunch of additional strategies, such as:'''&lt;br /&gt;
::-Generating elements trees of arbitrary depth&lt;br /&gt;
::-Generating sibling elements&lt;br /&gt;
::-Extending the set of CSS properties that can be generated (display, background, float, padding, margin, border, etc.)&lt;br /&gt;
::-Extending the set of elements that can be generated (span, div, header elements, table (and associated table contents), etc.)&lt;br /&gt;
::-Randomly choose whether to generate a document in quirks mode or not&lt;br /&gt;
:For task 3 there are several different parts, but the main goal is to increase the complexity of our randomly generated pages. The code_generation.py file will be adapted to provide these functions. The function used to add random sections will have recursion added to generate elements within elements, resulting in a tree of html elements. The amounting of nesting will be random but limited. Within the sections, tables, lists, spans, and divs may potentially be created. This will involve writing new functions for creating each element, and allowing them to be chosen at random by the function that creates sections of the HTML document. Additionally, the function which provides randomized CSS styling will be extended to generate additional properties.&lt;br /&gt;
&lt;br /&gt;
==Testing==&lt;br /&gt;
Because of the nature of this project, testing the newly added features will be very simple. For task 1, once we are actually controlling Firefox using geckodriver we will know it is working.  Task 2 actually involves us comparing screenshots.  By running the code with images that are the same and images that are different, we will be able to test to see if the comparisons work.  Additionally, we will be able to visually test that task 3 is complete (seeing that the new page generation features work).  While we could probably automate some of the testing for task 2 and 3 (to test all possible scenarios) it is out of the scope of this project.&lt;br /&gt;
&lt;br /&gt;
==Conclusion==&lt;br /&gt;
The previously completed work allows us to generate simple html documents with a randomized structure, render the page in Servo, and take a screenshot of the page. We plan on furthering this work by rendering the pages in both Servo and Firefox, taking screenshots of the pages within both browsers, and reporting differences between the two. Doing so will allow users to evaluate Servo’s ability to load web pages. To make this testing even more informative, we plan to increase the complexity of the structure and styling of the randomly generated html documents.&lt;/div&gt;</summary>
		<author><name>Adsimps3</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2018-_Project_M1803:_Implement_a_web_page_fuzzer_to_find_rendering_mismatches_(Part_2)&amp;diff=116697</id>
		<title>CSC/ECE 517 Spring 2018- Project M1803: Implement a web page fuzzer to find rendering mismatches (Part 2)</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2018-_Project_M1803:_Implement_a_web_page_fuzzer_to_find_rendering_mismatches_(Part_2)&amp;diff=116697"/>
		<updated>2018-04-15T20:40:01Z</updated>

		<summary type="html">&lt;p&gt;Adsimps3: /* Background */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;By Alexander Simpson(adsimps3), Abhay Soni (asoni3), Dileep badveli (dbadvel) and Jake Batty(jbatty)&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
This Mozilla project was broken in to 2 main parts: the initial and subsequent steps.  The initial steps were finished as a part of the OSS project.  The goal of this final project is to complete the subsequent steps.  As a part of the OSS project (explained more below) we created a tool which generates random valid HTML files and automated servo.  Now, as a part of this project we are supposed to extend the program to also control Firefox, compare the resulting screenshots, and expand upon the page generation tool.&lt;br /&gt;
&lt;br /&gt;
==Background==&lt;br /&gt;
[https://en.wikipedia.org/wiki/Servo_(layout_engine) Servo] is research project developed by Mozilla to &amp;quot;to create a new layout engine using a modern programming language&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
==Previous Work (Part of the OSS Project)==&lt;br /&gt;
&lt;br /&gt;
As per the [https://github.com/servo/servo/wiki/Random-web-content-project project description], we were expected to complete the initial steps. The implementation is explained below for each of these steps.&lt;br /&gt;
&lt;br /&gt;
:1) In a new repository, create a program that can generate a skeleton HTML file with a doctype, head element, and body element, print the result to stdout&lt;br /&gt;
::- Here is the [https://github.com/asoni3/Random-web-content-generator---CSC-517-OSS-Project link] to the repository which contains code_generation.py file which will be used to generate random valid HTML files.&lt;br /&gt;
:2) Add a module to the program that enable generating random content specific to the &amp;lt;head&amp;gt; element (such as inline CSS content inside of a &amp;lt;style&amp;gt; element) and add it to the generated output&lt;br /&gt;
::- The file [https://github.com/asoni3/Random-web-content-generator---CSC-517-OSS-Project/blob/master/code_generation.py code_generation.py], contains the code which generates random content specific to the head element and adds style on top of it. As seen in this code, after generating random content to the file, we will add CSS elements on top of this content. We have established a list of commonly used styles, weights, fonts, font_styles, and alignments which will be used at random. For practical purposes, we are limiting the number of options.&lt;br /&gt;
:3) Add a module to the program that enables generating random content specific to the &amp;lt;body&amp;gt; element (such as a &amp;lt;p&amp;gt; block that contains randomly generated text) and add it to the generated output&lt;br /&gt;
:4) Generate simple random CSS that affects randomly generated content (ie. if there is an element with an id foo, generate a CSS selector like #foo that applies a style like colorto it)&lt;br /&gt;
:5) Create a program under Servo's etc/ that launches Servo and causes it to [https://github.com/servo/servo/wiki/Control-Servo-using-WebDriver take a screenshot] of a particular URL - use this to take screenshots of pages randomly generated by the previous program&lt;br /&gt;
:Sample Screenshot:&lt;br /&gt;
:[[File:Servoscreenshot.png|border]]&lt;br /&gt;
&lt;br /&gt;
==Work to be done==&lt;br /&gt;
Below is a list of the tasks to be done as a part of our final project.  Below each task we have described what we think it will take to complete the respective task.  &lt;br /&gt;
 &lt;br /&gt;
:'''1) Extend the program that controls Servo to also control Firefox using geckodriver'''&lt;br /&gt;
:Task 1 is relatively simple.  It just involves downloading geckodriver and running it.  Geckodriver is an open source software engine that allows us to render marked content on a web browser.  It should allow us to take screenshots of a particular URL just like task 5 in the previous work section.  &lt;br /&gt;
&lt;br /&gt;
:'''2) Compare the resulting screenshots and report the contents of the generated page if the screenshots differ'''&lt;br /&gt;
:This task involves automating Firefox to use geckodriver and the current servo program.  They both will create 2 different screenshots.  If servo and Firefox render it differently, we will report that file and mark the differences.  &lt;br /&gt;
:To actually make the comparisons we will use [https://opencv.org/ OpenCV].  OpenCV will allow us to not only make comparisons but will also mark where the differences in.  To actually do the comparisons we will first convert the images to grayscale and then call compare_ssim().  This will get us a ''score'' and diff ''values''.  The ''score'' variables represents how close the to images are to each other and the ''diff'' variables tells us where the differences are.  If the ''score'' indicates that the images are different we will use the ''diff'' value to findContours() and then draw a rectangle around the differences.  &lt;br /&gt;
&lt;br /&gt;
:'''3) Extend the page generation tool with a bunch of additional strategies, such as:'''&lt;br /&gt;
::-Generating elements trees of arbitrary depth&lt;br /&gt;
::-Generating sibling elements&lt;br /&gt;
::-Extending the set of CSS properties that can be generated (display, background, float, padding, margin, border, etc.)&lt;br /&gt;
::-Extending the set of elements that can be generated (span, div, header elements, table (and associated table contents), etc.)&lt;br /&gt;
::-Randomly choose whether to generate a document in quirks mode or not&lt;br /&gt;
:For task 3 there are several different parts, but the main goal is to increase the complexity of our randomly generated pages. The code_generation.py file will be adapted to provide these functions. The function used to add random sections will have recursion added to generate elements within elements, resulting in a tree of html elements. The amounting of nesting will be random but limited. Within the sections, tables, lists, spans, and divs may potentially be created. This will involve writing new functions for creating each element, and allowing them to be chosen at random by the function that creates sections of the HTML document. Additionally, the function which provides randomized CSS styling will be extended to generate additional properties.&lt;br /&gt;
&lt;br /&gt;
==Testing==&lt;br /&gt;
Because of the nature of this project, testing the newly added features will be very simple. For task 1, once we are actually controlling Firefox using geckodriver we will know it is working.  Task 2 actually involves us comparing screenshots.  By running the code with images that are the same and images that are different, we will be able to test to see if the comparisons work.  Additionally, we will be able to visually test that task 3 is complete (seeing that the new page generation features work).  While we could probably automate some of the testing for task 2 and 3 (to test all possible scenarios) it is out of the scope of this project.&lt;br /&gt;
&lt;br /&gt;
==Conclusion==&lt;br /&gt;
The previously completed work allows us to generate simple html documents with a randomized structure, render the page in Servo, and take a screenshot of the page. We plan on furthering this work by rendering the pages in both Servo and Firefox, taking screenshots of the pages within both browsers, and reporting differences between the two. Doing so will allow users to evaluate Servo’s ability to load web pages. To make this testing even more informative, we plan to increase the complexity of the structure and styling of the randomly generated html documents.&lt;/div&gt;</summary>
		<author><name>Adsimps3</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2018-_Project_M1803:_Implement_a_web_page_fuzzer_to_find_rendering_mismatches_(Part_2)&amp;diff=116695</id>
		<title>CSC/ECE 517 Spring 2018- Project M1803: Implement a web page fuzzer to find rendering mismatches (Part 2)</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2018-_Project_M1803:_Implement_a_web_page_fuzzer_to_find_rendering_mismatches_(Part_2)&amp;diff=116695"/>
		<updated>2018-04-15T20:31:59Z</updated>

		<summary type="html">&lt;p&gt;Adsimps3: /* Testing */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;By Alexander Simpson(adsimps3), Abhay Soni (asoni3), Dileep badveli (dbadvel) and Jake Batty(jbatty)&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
This Mozilla project was broken in to 2 main parts: the initial and subsequent steps.  The initial steps were finished as a part of the OSS project.  The goal of this final project is to complete the subsequent steps.  As a part of the OSS project (explained more below) we created a tool which generates random valid HTML files and automated servo.  Now, as a part of this project we are supposed to extend the program to also control Firefox, compare the resulting screenshots, and expand upon the page generation tool.&lt;br /&gt;
&lt;br /&gt;
==Background==&lt;br /&gt;
TODO: explain servo&lt;br /&gt;
&lt;br /&gt;
==Previous Work (Part of the OSS Project)==&lt;br /&gt;
&lt;br /&gt;
As per the [https://github.com/servo/servo/wiki/Random-web-content-project project description], we were expected to complete the initial steps. The implementation is explained below for each of these steps.&lt;br /&gt;
&lt;br /&gt;
:1) In a new repository, create a program that can generate a skeleton HTML file with a doctype, head element, and body element, print the result to stdout&lt;br /&gt;
::- Here is the [https://github.com/asoni3/Random-web-content-generator---CSC-517-OSS-Project link] to the repository which contains code_generation.py file which will be used to generate random valid HTML files.&lt;br /&gt;
:2) Add a module to the program that enable generating random content specific to the &amp;lt;head&amp;gt; element (such as inline CSS content inside of a &amp;lt;style&amp;gt; element) and add it to the generated output&lt;br /&gt;
::- The file [https://github.com/asoni3/Random-web-content-generator---CSC-517-OSS-Project/blob/master/code_generation.py code_generation.py], contains the code which generates random content specific to the head element and adds style on top of it. As seen in this code, after generating random content to the file, we will add CSS elements on top of this content. We have established a list of commonly used styles, weights, fonts, font_styles, and alignments which will be used at random. For practical purposes, we are limiting the number of options.&lt;br /&gt;
:3) Add a module to the program that enables generating random content specific to the &amp;lt;body&amp;gt; element (such as a &amp;lt;p&amp;gt; block that contains randomly generated text) and add it to the generated output&lt;br /&gt;
:4) Generate simple random CSS that affects randomly generated content (ie. if there is an element with an id foo, generate a CSS selector like #foo that applies a style like colorto it)&lt;br /&gt;
:5) Create a program under Servo's etc/ that launches Servo and causes it to [https://github.com/servo/servo/wiki/Control-Servo-using-WebDriver take a screenshot] of a particular URL - use this to take screenshots of pages randomly generated by the previous program&lt;br /&gt;
:Sample Screenshot:&lt;br /&gt;
:[[File:Servoscreenshot.png|border]]&lt;br /&gt;
&lt;br /&gt;
==Work to be done==&lt;br /&gt;
Below is a list of the tasks to be done as a part of our final project.  Below each task we have described what we think it will take to complete the respective task.  &lt;br /&gt;
 &lt;br /&gt;
:'''1) Extend the program that controls Servo to also control Firefox using geckodriver'''&lt;br /&gt;
:Task 1 is relatively simple.  It just involves downloading geckodriver and running it.  Geckodriver is an open source software engine that allows us to render marked content on a web browser.  It should allow us to take screenshots of a particular URL just like task 5 in the previous work section.  &lt;br /&gt;
&lt;br /&gt;
:'''2) Compare the resulting screenshots and report the contents of the generated page if the screenshots differ'''&lt;br /&gt;
:This task involves automating Firefox to use geckodriver and the current servo program.  They both will create 2 different screenshots.  If servo and Firefox render it differently, we will report that file and mark the differences.  &lt;br /&gt;
:To actually make the comparisons we will use [https://opencv.org/ OpenCV].  OpenCV will allow us to not only make comparisons but will also mark where the differences in.  To actually do the comparisons we will first convert the images to grayscale and then call compare_ssim().  This will get us a ''score'' and diff ''values''.  The ''score'' variables represents how close the to images are to each other and the ''diff'' variables tells us where the differences are.  If the ''score'' indicates that the images are different we will use the ''diff'' value to findContours() and then draw a rectangle around the differences.  &lt;br /&gt;
&lt;br /&gt;
:'''3) Extend the page generation tool with a bunch of additional strategies, such as:'''&lt;br /&gt;
::-Generating elements trees of arbitrary depth&lt;br /&gt;
::-Generating sibling elements&lt;br /&gt;
::-Extending the set of CSS properties that can be generated (display, background, float, padding, margin, border, etc.)&lt;br /&gt;
::-Extending the set of elements that can be generated (span, div, header elements, table (and associated table contents), etc.)&lt;br /&gt;
::-Randomly choose whether to generate a document in quirks mode or not&lt;br /&gt;
:For task 3 there are several different parts, but the main goal is to increase the complexity of our randomly generated pages.  First we will increase the tree depth to an arbitrary depth.  We will then generate sibling elements and increase the CSS styling options.  Finally, we will increase the amount of HTML elements that can be generated and randomly choose whether to generate a document in quirks mode or not.&lt;br /&gt;
:The code_generation.py file will be adapted to provide these functions. The function used to add random sections will have recursion added to generate elements within elements, resulting in a tree of html elements. The amounting of nesting will be random but limited. Within the sections, tables, lists, spans, and divs may potentially be created. This will involve writing new functions for creating each element, and allowing them to be chosen at random by the function that creates sections of the HTML document.&lt;br /&gt;
&lt;br /&gt;
==Testing==&lt;br /&gt;
Because of the nature of this project, testing the newly added features will be very simple. For task 1, once we are actually controlling Firefox using geckodriver we will know it is working.  Task 2 actually involves us comparing screenshots.  By running the code with images that are the same and images that are different, we will be able to test to see if the comparisons work.  Additionally, we will be able to visually test that task 3 is complete (seeing that the new page generation features work).  While we could probably automate some of the testing for task 2 and 3 (to test all possible scenarios) it is out of the scope of this project.&lt;br /&gt;
&lt;br /&gt;
==Conclusion==&lt;br /&gt;
The previously completed work allows us to generate simple html documents with a randomized structure, render the page in Servo, and take a screenshot of the page. We plan on furthering this work by rendering the pages in both Servo and Firefox, taking screenshots of the pages within both browsers, and reporting differences between the two. Doing so will allow users to evaluate Servo’s ability to load web pages. To make this testing even more informative, we plan to increase the complexity of the structure and styling of the randomly generated html documents.&lt;/div&gt;</summary>
		<author><name>Adsimps3</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2018-_Project_M1803:_Implement_a_web_page_fuzzer_to_find_rendering_mismatches_(Part_2)&amp;diff=116694</id>
		<title>CSC/ECE 517 Spring 2018- Project M1803: Implement a web page fuzzer to find rendering mismatches (Part 2)</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2018-_Project_M1803:_Implement_a_web_page_fuzzer_to_find_rendering_mismatches_(Part_2)&amp;diff=116694"/>
		<updated>2018-04-15T20:30:57Z</updated>

		<summary type="html">&lt;p&gt;Adsimps3: /* Testing */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;By Alexander Simpson(adsimps3), Abhay Soni (asoni3), Dileep badveli (dbadvel) and Jake Batty(jbatty)&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
This Mozilla project was broken in to 2 main parts: the initial and subsequent steps.  The initial steps were finished as a part of the OSS project.  The goal of this final project is to complete the subsequent steps.  As a part of the OSS project (explained more below) we created a tool which generates random valid HTML files and automated servo.  Now, as a part of this project we are supposed to extend the program to also control Firefox, compare the resulting screenshots, and expand upon the page generation tool.&lt;br /&gt;
&lt;br /&gt;
==Background==&lt;br /&gt;
TODO: explain servo&lt;br /&gt;
&lt;br /&gt;
==Previous Work (Part of the OSS Project)==&lt;br /&gt;
&lt;br /&gt;
As per the [https://github.com/servo/servo/wiki/Random-web-content-project project description], we were expected to complete the initial steps. The implementation is explained below for each of these steps.&lt;br /&gt;
&lt;br /&gt;
:1) In a new repository, create a program that can generate a skeleton HTML file with a doctype, head element, and body element, print the result to stdout&lt;br /&gt;
::- Here is the [https://github.com/asoni3/Random-web-content-generator---CSC-517-OSS-Project link] to the repository which contains code_generation.py file which will be used to generate random valid HTML files.&lt;br /&gt;
:2) Add a module to the program that enable generating random content specific to the &amp;lt;head&amp;gt; element (such as inline CSS content inside of a &amp;lt;style&amp;gt; element) and add it to the generated output&lt;br /&gt;
::- The file [https://github.com/asoni3/Random-web-content-generator---CSC-517-OSS-Project/blob/master/code_generation.py code_generation.py], contains the code which generates random content specific to the head element and adds style on top of it. As seen in this code, after generating random content to the file, we will add CSS elements on top of this content. We have established a list of commonly used styles, weights, fonts, font_styles, and alignments which will be used at random. For practical purposes, we are limiting the number of options.&lt;br /&gt;
:3) Add a module to the program that enables generating random content specific to the &amp;lt;body&amp;gt; element (such as a &amp;lt;p&amp;gt; block that contains randomly generated text) and add it to the generated output&lt;br /&gt;
:4) Generate simple random CSS that affects randomly generated content (ie. if there is an element with an id foo, generate a CSS selector like #foo that applies a style like colorto it)&lt;br /&gt;
:5) Create a program under Servo's etc/ that launches Servo and causes it to [https://github.com/servo/servo/wiki/Control-Servo-using-WebDriver take a screenshot] of a particular URL - use this to take screenshots of pages randomly generated by the previous program&lt;br /&gt;
:Sample Screenshot:&lt;br /&gt;
:[[File:Servoscreenshot.png|border]]&lt;br /&gt;
&lt;br /&gt;
==Work to be done==&lt;br /&gt;
Below is a list of the tasks to be done as a part of our final project.  Below each task we have described what we think it will take to complete the respective task.  &lt;br /&gt;
 &lt;br /&gt;
:'''1) Extend the program that controls Servo to also control Firefox using geckodriver'''&lt;br /&gt;
:Task 1 is relatively simple.  It just involves downloading geckodriver and running it.  Geckodriver is an open source software engine that allows us to render marked content on a web browser.  It should allow us to take screenshots of a particular URL just like task 5 in the previous work section.  &lt;br /&gt;
&lt;br /&gt;
:'''2) Compare the resulting screenshots and report the contents of the generated page if the screenshots differ'''&lt;br /&gt;
:This task involves automating Firefox to use geckodriver and the current servo program.  They both will create 2 different screenshots.  If servo and Firefox render it differently, we will report that file and mark the differences.  &lt;br /&gt;
:To actually make the comparisons we will use [https://opencv.org/ OpenCV].  OpenCV will allow us to not only make comparisons but will also mark where the differences in.  To actually do the comparisons we will first convert the images to grayscale and then call compare_ssim().  This will get us a ''score'' and diff ''values''.  The ''score'' variables represents how close the to images are to each other and the ''diff'' variables tells us where the differences are.  If the ''score'' indicates that the images are different we will use the ''diff'' value to findContours() and then draw a rectangle around the differences.  &lt;br /&gt;
&lt;br /&gt;
:'''3) Extend the page generation tool with a bunch of additional strategies, such as:'''&lt;br /&gt;
::-Generating elements trees of arbitrary depth&lt;br /&gt;
::-Generating sibling elements&lt;br /&gt;
::-Extending the set of CSS properties that can be generated (display, background, float, padding, margin, border, etc.)&lt;br /&gt;
::-Extending the set of elements that can be generated (span, div, header elements, table (and associated table contents), etc.)&lt;br /&gt;
::-Randomly choose whether to generate a document in quirks mode or not&lt;br /&gt;
:For task 3 there are several different parts, but the main goal is to increase the complexity of our randomly generated pages.  First we will increase the tree depth to an arbitrary depth.  We will then generate sibling elements and increase the CSS styling options.  Finally, we will increase the amount of HTML elements that can be generated and randomly choose whether to generate a document in quirks mode or not.&lt;br /&gt;
:The code_generation.py file will be adapted to provide these functions. The function used to add random sections will have recursion added to generate elements within elements, resulting in a tree of html elements. The amounting of nesting will be random but limited. Within the sections, tables, lists, spans, and divs may potentially be created. This will involve writing new functions for creating each element, and allowing them to be chosen at random by the function that creates sections of the HTML document.&lt;br /&gt;
&lt;br /&gt;
==Testing==&lt;br /&gt;
Because of the nature of this project, testing the newly added features will be very simple. For task 1, once we are actually controlling Firefox using geckodriver we will know it is working.  For Task 2 actually involves us comparing screenshots.  By running the code with images that are the same and images that are different, we will be able to test to see if the comparisons work.  Additionally, we will be able to visually test that task 3 is complete (seeing that the new page generation features work).  While we could probably automate some of the testing for task 2 and 3 (to test all possible scenarios) it is out of the scope of this project.&lt;br /&gt;
&lt;br /&gt;
==Conclusion==&lt;br /&gt;
The previously completed work allows us to generate simple html documents with a randomized structure, render the page in Servo, and take a screenshot of the page. We plan on furthering this work by rendering the pages in both Servo and Firefox, taking screenshots of the pages within both browsers, and reporting differences between the two. Doing so will allow users to evaluate Servo’s ability to load web pages. To make this testing even more informative, we plan to increase the complexity of the structure and styling of the randomly generated html documents.&lt;/div&gt;</summary>
		<author><name>Adsimps3</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2018-_Project_M1803:_Implement_a_web_page_fuzzer_to_find_rendering_mismatches_(Part_2)&amp;diff=116693</id>
		<title>CSC/ECE 517 Spring 2018- Project M1803: Implement a web page fuzzer to find rendering mismatches (Part 2)</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2018-_Project_M1803:_Implement_a_web_page_fuzzer_to_find_rendering_mismatches_(Part_2)&amp;diff=116693"/>
		<updated>2018-04-15T20:30:19Z</updated>

		<summary type="html">&lt;p&gt;Adsimps3: /* Testing */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;By Alexander Simpson(adsimps3), Abhay Soni (asoni3), Dileep badveli (dbadvel) and Jake Batty(jbatty)&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
This Mozilla project was broken in to 2 main parts: the initial and subsequent steps.  The initial steps were finished as a part of the OSS project.  The goal of this final project is to complete the subsequent steps.  As a part of the OSS project (explained more below) we created a tool which generates random valid HTML files and automated servo.  Now, as a part of this project we are supposed to extend the program to also control Firefox, compare the resulting screenshots, and expand upon the page generation tool.&lt;br /&gt;
&lt;br /&gt;
==Background==&lt;br /&gt;
TODO: explain servo&lt;br /&gt;
&lt;br /&gt;
==Previous Work (Part of the OSS Project)==&lt;br /&gt;
&lt;br /&gt;
As per the [https://github.com/servo/servo/wiki/Random-web-content-project project description], we were expected to complete the initial steps. The implementation is explained below for each of these steps.&lt;br /&gt;
&lt;br /&gt;
:1) In a new repository, create a program that can generate a skeleton HTML file with a doctype, head element, and body element, print the result to stdout&lt;br /&gt;
::- Here is the [https://github.com/asoni3/Random-web-content-generator---CSC-517-OSS-Project link] to the repository which contains code_generation.py file which will be used to generate random valid HTML files.&lt;br /&gt;
:2) Add a module to the program that enable generating random content specific to the &amp;lt;head&amp;gt; element (such as inline CSS content inside of a &amp;lt;style&amp;gt; element) and add it to the generated output&lt;br /&gt;
::- The file [https://github.com/asoni3/Random-web-content-generator---CSC-517-OSS-Project/blob/master/code_generation.py code_generation.py], contains the code which generates random content specific to the head element and adds style on top of it. As seen in this code, after generating random content to the file, we will add CSS elements on top of this content. We have established a list of commonly used styles, weights, fonts, font_styles, and alignments which will be used at random. For practical purposes, we are limiting the number of options.&lt;br /&gt;
:3) Add a module to the program that enables generating random content specific to the &amp;lt;body&amp;gt; element (such as a &amp;lt;p&amp;gt; block that contains randomly generated text) and add it to the generated output&lt;br /&gt;
:4) Generate simple random CSS that affects randomly generated content (ie. if there is an element with an id foo, generate a CSS selector like #foo that applies a style like colorto it)&lt;br /&gt;
:5) Create a program under Servo's etc/ that launches Servo and causes it to [https://github.com/servo/servo/wiki/Control-Servo-using-WebDriver take a screenshot] of a particular URL - use this to take screenshots of pages randomly generated by the previous program&lt;br /&gt;
:Sample Screenshot:&lt;br /&gt;
:[[File:Servoscreenshot.png|border]]&lt;br /&gt;
&lt;br /&gt;
==Work to be done==&lt;br /&gt;
Below is a list of the tasks to be done as a part of our final project.  Below each task we have described what we think it will take to complete the respective task.  &lt;br /&gt;
 &lt;br /&gt;
:'''1) Extend the program that controls Servo to also control Firefox using geckodriver'''&lt;br /&gt;
:Task 1 is relatively simple.  It just involves downloading geckodriver and running it.  Geckodriver is an open source software engine that allows us to render marked content on a web browser.  It should allow us to take screenshots of a particular URL just like task 5 in the previous work section.  &lt;br /&gt;
&lt;br /&gt;
:'''2) Compare the resulting screenshots and report the contents of the generated page if the screenshots differ'''&lt;br /&gt;
:This task involves automating Firefox to use geckodriver and the current servo program.  They both will create 2 different screenshots.  If servo and Firefox render it differently, we will report that file and mark the differences.  &lt;br /&gt;
:To actually make the comparisons we will use [https://opencv.org/ OpenCV].  OpenCV will allow us to not only make comparisons but will also mark where the differences in.  To actually do the comparisons we will first convert the images to grayscale and then call compare_ssim().  This will get us a ''score'' and diff ''values''.  The ''score'' variables represents how close the to images are to each other and the ''diff'' variables tells us where the differences are.  If the ''score'' indicates that the images are different we will use the ''diff'' value to findContours() and then draw a rectangle around the differences.  &lt;br /&gt;
&lt;br /&gt;
:'''3) Extend the page generation tool with a bunch of additional strategies, such as:'''&lt;br /&gt;
::-Generating elements trees of arbitrary depth&lt;br /&gt;
::-Generating sibling elements&lt;br /&gt;
::-Extending the set of CSS properties that can be generated (display, background, float, padding, margin, border, etc.)&lt;br /&gt;
::-Extending the set of elements that can be generated (span, div, header elements, table (and associated table contents), etc.)&lt;br /&gt;
::-Randomly choose whether to generate a document in quirks mode or not&lt;br /&gt;
:For task 3 there are several different parts, but the main goal is to increase the complexity of our randomly generated pages.  First we will increase the tree depth to an arbitrary depth.  We will then generate sibling elements and increase the CSS styling options.  Finally, we will increase the amount of HTML elements that can be generated and randomly choose whether to generate a document in quirks mode or not.&lt;br /&gt;
:The code_generation.py file will be adapted to provide these functions. The function used to add random sections will have recursion added to generate elements within elements, resulting in a tree of html elements. The amounting of nesting will be random but limited. Within the sections, tables, lists, spans, and divs may potentially be created. This will involve writing new functions for creating each element, and allowing them to be chosen at random by the function that creates sections of the HTML document.&lt;br /&gt;
&lt;br /&gt;
==Testing==&lt;br /&gt;
Because of the nature of this project, testing the newly added features will be very simple. For task 1, once we are actually controlling Task 2 actually involves us comparing screenshots.  By running the code with images that are the same and images that are different, we will be able to test to see if the comparisons work.  Additionally, we will be able to visually test that task 3 is complete (seeing that the new page generation features work).  While we could probably automate some of the testing for task 2 and 3 (to test all possible scenarios) it is out of the scope of this project.&lt;br /&gt;
&lt;br /&gt;
==Conclusion==&lt;br /&gt;
The previously completed work allows us to generate simple html documents with a randomized structure, render the page in Servo, and take a screenshot of the page. We plan on furthering this work by rendering the pages in both Servo and Firefox, taking screenshots of the pages within both browsers, and reporting differences between the two. Doing so will allow users to evaluate Servo’s ability to load web pages. To make this testing even more informative, we plan to increase the complexity of the structure and styling of the randomly generated html documents.&lt;/div&gt;</summary>
		<author><name>Adsimps3</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2018-_Project_M1803:_Implement_a_web_page_fuzzer_to_find_rendering_mismatches_(Part_2)&amp;diff=116692</id>
		<title>CSC/ECE 517 Spring 2018- Project M1803: Implement a web page fuzzer to find rendering mismatches (Part 2)</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2018-_Project_M1803:_Implement_a_web_page_fuzzer_to_find_rendering_mismatches_(Part_2)&amp;diff=116692"/>
		<updated>2018-04-15T20:29:54Z</updated>

		<summary type="html">&lt;p&gt;Adsimps3: /* Testing */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;By Alexander Simpson(adsimps3), Abhay Soni (asoni3), Dileep badveli (dbadvel) and Jake Batty(jbatty)&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
This Mozilla project was broken in to 2 main parts: the initial and subsequent steps.  The initial steps were finished as a part of the OSS project.  The goal of this final project is to complete the subsequent steps.  As a part of the OSS project (explained more below) we created a tool which generates random valid HTML files and automated servo.  Now, as a part of this project we are supposed to extend the program to also control Firefox, compare the resulting screenshots, and expand upon the page generation tool.&lt;br /&gt;
&lt;br /&gt;
==Background==&lt;br /&gt;
TODO: explain servo&lt;br /&gt;
&lt;br /&gt;
==Previous Work (Part of the OSS Project)==&lt;br /&gt;
&lt;br /&gt;
As per the [https://github.com/servo/servo/wiki/Random-web-content-project project description], we were expected to complete the initial steps. The implementation is explained below for each of these steps.&lt;br /&gt;
&lt;br /&gt;
:1) In a new repository, create a program that can generate a skeleton HTML file with a doctype, head element, and body element, print the result to stdout&lt;br /&gt;
::- Here is the [https://github.com/asoni3/Random-web-content-generator---CSC-517-OSS-Project link] to the repository which contains code_generation.py file which will be used to generate random valid HTML files.&lt;br /&gt;
:2) Add a module to the program that enable generating random content specific to the &amp;lt;head&amp;gt; element (such as inline CSS content inside of a &amp;lt;style&amp;gt; element) and add it to the generated output&lt;br /&gt;
::- The file [https://github.com/asoni3/Random-web-content-generator---CSC-517-OSS-Project/blob/master/code_generation.py code_generation.py], contains the code which generates random content specific to the head element and adds style on top of it. As seen in this code, after generating random content to the file, we will add CSS elements on top of this content. We have established a list of commonly used styles, weights, fonts, font_styles, and alignments which will be used at random. For practical purposes, we are limiting the number of options.&lt;br /&gt;
:3) Add a module to the program that enables generating random content specific to the &amp;lt;body&amp;gt; element (such as a &amp;lt;p&amp;gt; block that contains randomly generated text) and add it to the generated output&lt;br /&gt;
:4) Generate simple random CSS that affects randomly generated content (ie. if there is an element with an id foo, generate a CSS selector like #foo that applies a style like colorto it)&lt;br /&gt;
:5) Create a program under Servo's etc/ that launches Servo and causes it to [https://github.com/servo/servo/wiki/Control-Servo-using-WebDriver take a screenshot] of a particular URL - use this to take screenshots of pages randomly generated by the previous program&lt;br /&gt;
:Sample Screenshot:&lt;br /&gt;
:[[File:Servoscreenshot.png|border]]&lt;br /&gt;
&lt;br /&gt;
==Work to be done==&lt;br /&gt;
Below is a list of the tasks to be done as a part of our final project.  Below each task we have described what we think it will take to complete the respective task.  &lt;br /&gt;
 &lt;br /&gt;
:'''1) Extend the program that controls Servo to also control Firefox using geckodriver'''&lt;br /&gt;
:Task 1 is relatively simple.  It just involves downloading geckodriver and running it.  Geckodriver is an open source software engine that allows us to render marked content on a web browser.  It should allow us to take screenshots of a particular URL just like task 5 in the previous work section.  &lt;br /&gt;
&lt;br /&gt;
:'''2) Compare the resulting screenshots and report the contents of the generated page if the screenshots differ'''&lt;br /&gt;
:This task involves automating Firefox to use geckodriver and the current servo program.  They both will create 2 different screenshots.  If servo and Firefox render it differently, we will report that file and mark the differences.  &lt;br /&gt;
:To actually make the comparisons we will use [https://opencv.org/ OpenCV].  OpenCV will allow us to not only make comparisons but will also mark where the differences in.  To actually do the comparisons we will first convert the images to grayscale and then call compare_ssim().  This will get us a ''score'' and diff ''values''.  The ''score'' variables represents how close the to images are to each other and the ''diff'' variables tells us where the differences are.  If the ''score'' indicates that the images are different we will use the ''diff'' value to findContours() and then draw a rectangle around the differences.  &lt;br /&gt;
&lt;br /&gt;
:'''3) Extend the page generation tool with a bunch of additional strategies, such as:'''&lt;br /&gt;
::-Generating elements trees of arbitrary depth&lt;br /&gt;
::-Generating sibling elements&lt;br /&gt;
::-Extending the set of CSS properties that can be generated (display, background, float, padding, margin, border, etc.)&lt;br /&gt;
::-Extending the set of elements that can be generated (span, div, header elements, table (and associated table contents), etc.)&lt;br /&gt;
::-Randomly choose whether to generate a document in quirks mode or not&lt;br /&gt;
:For task 3 there are several different parts, but the main goal is to increase the complexity of our randomly generated pages.  First we will increase the tree depth to an arbitrary depth.  We will then generate sibling elements and increase the CSS styling options.  Finally, we will increase the amount of HTML elements that can be generated and randomly choose whether to generate a document in quirks mode or not.&lt;br /&gt;
:The code_generation.py file will be adapted to provide these functions. The function used to add random sections will have recursion added to generate elements within elements, resulting in a tree of html elements. The amounting of nesting will be random but limited. Within the sections, tables, lists, spans, and divs may potentially be created. This will involve writing new functions for creating each element, and allowing them to be chosen at random by the function that creates sections of the HTML document.&lt;br /&gt;
&lt;br /&gt;
==Testing==&lt;br /&gt;
Because of the nature of this project, testing the newly added features will be very simple. For task 1, Task 2 actually involves us comparing screenshots.  By running the code with images that are the same and images that are different, we will be able to test to see if the comparisons work.  Additionally, we will be able to visually test that task 3 is complete (seeing that the new page generation features work).  While we could probably automate some of the testing for task 2 and 3 (to test all possible scenarios) it is out of the scope of this project.&lt;br /&gt;
&lt;br /&gt;
==Conclusion==&lt;br /&gt;
The previously completed work allows us to generate simple html documents with a randomized structure, render the page in Servo, and take a screenshot of the page. We plan on furthering this work by rendering the pages in both Servo and Firefox, taking screenshots of the pages within both browsers, and reporting differences between the two. Doing so will allow users to evaluate Servo’s ability to load web pages. To make this testing even more informative, we plan to increase the complexity of the structure and styling of the randomly generated html documents.&lt;/div&gt;</summary>
		<author><name>Adsimps3</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2018-_Project_M1803:_Implement_a_web_page_fuzzer_to_find_rendering_mismatches_(Part_2)&amp;diff=116691</id>
		<title>CSC/ECE 517 Spring 2018- Project M1803: Implement a web page fuzzer to find rendering mismatches (Part 2)</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2018-_Project_M1803:_Implement_a_web_page_fuzzer_to_find_rendering_mismatches_(Part_2)&amp;diff=116691"/>
		<updated>2018-04-15T20:28:06Z</updated>

		<summary type="html">&lt;p&gt;Adsimps3: /* Work to be done */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;By Alexander Simpson(adsimps3), Abhay Soni (asoni3), Dileep badveli (dbadvel) and Jake Batty(jbatty)&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
This Mozilla project was broken in to 2 main parts: the initial and subsequent steps.  The initial steps were finished as a part of the OSS project.  The goal of this final project is to complete the subsequent steps.  As a part of the OSS project (explained more below) we created a tool which generates random valid HTML files and automated servo.  Now, as a part of this project we are supposed to extend the program to also control Firefox, compare the resulting screenshots, and expand upon the page generation tool.&lt;br /&gt;
&lt;br /&gt;
==Background==&lt;br /&gt;
TODO: explain servo&lt;br /&gt;
&lt;br /&gt;
==Previous Work (Part of the OSS Project)==&lt;br /&gt;
&lt;br /&gt;
As per the [https://github.com/servo/servo/wiki/Random-web-content-project project description], we were expected to complete the initial steps. The implementation is explained below for each of these steps.&lt;br /&gt;
&lt;br /&gt;
:1) In a new repository, create a program that can generate a skeleton HTML file with a doctype, head element, and body element, print the result to stdout&lt;br /&gt;
::- Here is the [https://github.com/asoni3/Random-web-content-generator---CSC-517-OSS-Project link] to the repository which contains code_generation.py file which will be used to generate random valid HTML files.&lt;br /&gt;
:2) Add a module to the program that enable generating random content specific to the &amp;lt;head&amp;gt; element (such as inline CSS content inside of a &amp;lt;style&amp;gt; element) and add it to the generated output&lt;br /&gt;
::- The file [https://github.com/asoni3/Random-web-content-generator---CSC-517-OSS-Project/blob/master/code_generation.py code_generation.py], contains the code which generates random content specific to the head element and adds style on top of it. As seen in this code, after generating random content to the file, we will add CSS elements on top of this content. We have established a list of commonly used styles, weights, fonts, font_styles, and alignments which will be used at random. For practical purposes, we are limiting the number of options.&lt;br /&gt;
:3) Add a module to the program that enables generating random content specific to the &amp;lt;body&amp;gt; element (such as a &amp;lt;p&amp;gt; block that contains randomly generated text) and add it to the generated output&lt;br /&gt;
:4) Generate simple random CSS that affects randomly generated content (ie. if there is an element with an id foo, generate a CSS selector like #foo that applies a style like colorto it)&lt;br /&gt;
:5) Create a program under Servo's etc/ that launches Servo and causes it to [https://github.com/servo/servo/wiki/Control-Servo-using-WebDriver take a screenshot] of a particular URL - use this to take screenshots of pages randomly generated by the previous program&lt;br /&gt;
:Sample Screenshot:&lt;br /&gt;
:[[File:Servoscreenshot.png|border]]&lt;br /&gt;
&lt;br /&gt;
==Work to be done==&lt;br /&gt;
Below is a list of the tasks to be done as a part of our final project.  Below each task we have described what we think it will take to complete the respective task.  &lt;br /&gt;
 &lt;br /&gt;
:'''1) Extend the program that controls Servo to also control Firefox using geckodriver'''&lt;br /&gt;
:Task 1 is relatively simple.  It just involves downloading geckodriver and running it.  Geckodriver is an open source software engine that allows us to render marked content on a web browser.  It should allow us to take screenshots of a particular URL just like task 5 in the previous work section.  &lt;br /&gt;
&lt;br /&gt;
:'''2) Compare the resulting screenshots and report the contents of the generated page if the screenshots differ'''&lt;br /&gt;
:This task involves automating Firefox to use geckodriver and the current servo program.  They both will create 2 different screenshots.  If servo and Firefox render it differently, we will report that file and mark the differences.  &lt;br /&gt;
:To actually make the comparisons we will use [https://opencv.org/ OpenCV].  OpenCV will allow us to not only make comparisons but will also mark where the differences in.  To actually do the comparisons we will first convert the images to grayscale and then call compare_ssim().  This will get us a ''score'' and diff ''values''.  The ''score'' variables represents how close the to images are to each other and the ''diff'' variables tells us where the differences are.  If the ''score'' indicates that the images are different we will use the ''diff'' value to findContours() and then draw a rectangle around the differences.  &lt;br /&gt;
&lt;br /&gt;
:'''3) Extend the page generation tool with a bunch of additional strategies, such as:'''&lt;br /&gt;
::-Generating elements trees of arbitrary depth&lt;br /&gt;
::-Generating sibling elements&lt;br /&gt;
::-Extending the set of CSS properties that can be generated (display, background, float, padding, margin, border, etc.)&lt;br /&gt;
::-Extending the set of elements that can be generated (span, div, header elements, table (and associated table contents), etc.)&lt;br /&gt;
::-Randomly choose whether to generate a document in quirks mode or not&lt;br /&gt;
:For task 3 there are several different parts, but the main goal is to increase the complexity of our randomly generated pages.  First we will increase the tree depth to an arbitrary depth.  We will then generate sibling elements and increase the CSS styling options.  Finally, we will increase the amount of HTML elements that can be generated and randomly choose whether to generate a document in quirks mode or not.&lt;br /&gt;
:The code_generation.py file will be adapted to provide these functions. The function used to add random sections will have recursion added to generate elements within elements, resulting in a tree of html elements. The amounting of nesting will be random but limited. Within the sections, tables, lists, spans, and divs may potentially be created. This will involve writing new functions for creating each element, and allowing them to be chosen at random by the function that creates sections of the HTML document.&lt;br /&gt;
&lt;br /&gt;
==Testing==&lt;br /&gt;
Because of the nature of this project, testing the newly added features will be very simple. Task 2 actually involves us comparing screenshots.  By comparing the actual screenshots we will test that things work.  Additionally, we will be able to visually test that task 3 is complete (seeing that the new page generation features work).  While we could probably automate some of the testing for task 3 (to test all possible scenarios) it is out of the scope of this project.  &lt;br /&gt;
&lt;br /&gt;
==Conclusion==&lt;br /&gt;
The previously completed work allows us to generate simple html documents with a randomized structure, render the page in Servo, and take a screenshot of the page. We plan on furthering this work by rendering the pages in both Servo and Firefox, taking screenshots of the pages within both browsers, and reporting differences between the two. Doing so will allow users to evaluate Servo’s ability to load web pages. To make this testing even more informative, we plan to increase the complexity of the structure and styling of the randomly generated html documents.&lt;/div&gt;</summary>
		<author><name>Adsimps3</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2018-_Project_M1803:_Implement_a_web_page_fuzzer_to_find_rendering_mismatches_(Part_2)&amp;diff=116690</id>
		<title>CSC/ECE 517 Spring 2018- Project M1803: Implement a web page fuzzer to find rendering mismatches (Part 2)</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2018-_Project_M1803:_Implement_a_web_page_fuzzer_to_find_rendering_mismatches_(Part_2)&amp;diff=116690"/>
		<updated>2018-04-15T20:27:49Z</updated>

		<summary type="html">&lt;p&gt;Adsimps3: /* Work to be done */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;By Alexander Simpson(adsimps3), Abhay Soni (asoni3), Dileep badveli (dbadvel) and Jake Batty(jbatty)&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
This Mozilla project was broken in to 2 main parts: the initial and subsequent steps.  The initial steps were finished as a part of the OSS project.  The goal of this final project is to complete the subsequent steps.  As a part of the OSS project (explained more below) we created a tool which generates random valid HTML files and automated servo.  Now, as a part of this project we are supposed to extend the program to also control Firefox, compare the resulting screenshots, and expand upon the page generation tool.&lt;br /&gt;
&lt;br /&gt;
==Background==&lt;br /&gt;
TODO: explain servo&lt;br /&gt;
&lt;br /&gt;
==Previous Work (Part of the OSS Project)==&lt;br /&gt;
&lt;br /&gt;
As per the [https://github.com/servo/servo/wiki/Random-web-content-project project description], we were expected to complete the initial steps. The implementation is explained below for each of these steps.&lt;br /&gt;
&lt;br /&gt;
:1) In a new repository, create a program that can generate a skeleton HTML file with a doctype, head element, and body element, print the result to stdout&lt;br /&gt;
::- Here is the [https://github.com/asoni3/Random-web-content-generator---CSC-517-OSS-Project link] to the repository which contains code_generation.py file which will be used to generate random valid HTML files.&lt;br /&gt;
:2) Add a module to the program that enable generating random content specific to the &amp;lt;head&amp;gt; element (such as inline CSS content inside of a &amp;lt;style&amp;gt; element) and add it to the generated output&lt;br /&gt;
::- The file [https://github.com/asoni3/Random-web-content-generator---CSC-517-OSS-Project/blob/master/code_generation.py code_generation.py], contains the code which generates random content specific to the head element and adds style on top of it. As seen in this code, after generating random content to the file, we will add CSS elements on top of this content. We have established a list of commonly used styles, weights, fonts, font_styles, and alignments which will be used at random. For practical purposes, we are limiting the number of options.&lt;br /&gt;
:3) Add a module to the program that enables generating random content specific to the &amp;lt;body&amp;gt; element (such as a &amp;lt;p&amp;gt; block that contains randomly generated text) and add it to the generated output&lt;br /&gt;
:4) Generate simple random CSS that affects randomly generated content (ie. if there is an element with an id foo, generate a CSS selector like #foo that applies a style like colorto it)&lt;br /&gt;
:5) Create a program under Servo's etc/ that launches Servo and causes it to [https://github.com/servo/servo/wiki/Control-Servo-using-WebDriver take a screenshot] of a particular URL - use this to take screenshots of pages randomly generated by the previous program&lt;br /&gt;
:Sample Screenshot:&lt;br /&gt;
:[[File:Servoscreenshot.png|border]]&lt;br /&gt;
&lt;br /&gt;
==Work to be done==&lt;br /&gt;
Below is a list of the tasks to be done as a part of our final project.  Below each task we have described what we think it will take to complete the respective task.  &lt;br /&gt;
 &lt;br /&gt;
:'''1) Extend the program that controls Servo to also control Firefox using geckodriver'''&lt;br /&gt;
:Task 1 is relatively simple.  It just involves downloading geckodriver and running it.  Geckodriver is an open source software engine that allows us to render marked content on a web browser.  It should allow us to take screenshots of a particular URL just like task 5 in the previous work section.  &lt;br /&gt;
&lt;br /&gt;
:'''2) Compare the resulting screenshots and report the contents of the generated page if the screenshots differ'''&lt;br /&gt;
:This task involves automating Firefox to use geckodriver and the current servo program.  They both will create 2 different screenshots.  If servo and Firefox render it differently, we will report that file and mark the differences.  &lt;br /&gt;
:To actually make the comparisons we will use [https://opencv.org/ OpenCV].  OpenCV will allow us to not only make comparisons but will also mark where the differences in.  To actually do the comparisons we will first convert the images to grayscale and then call compare_ssim().  This will get us a ''score'' and diff ''values''.  The ''score'' variables represents how close the to images are to each other and the ''diff'' variables tells us where the differences are.  If the ''score'' indicates that the images are different we will use the ''diff'' value to findContours() and then draw a rectangle around the differences.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
:'''3) Extend the page generation tool with a bunch of additional strategies, such as:'''&lt;br /&gt;
::-Generating elements trees of arbitrary depth&lt;br /&gt;
::-Generating sibling elements&lt;br /&gt;
::-Extending the set of CSS properties that can be generated (display, background, float, padding, margin, border, etc.)&lt;br /&gt;
::-Extending the set of elements that can be generated (span, div, header elements, table (and associated table contents), etc.)&lt;br /&gt;
::-Randomly choose whether to generate a document in quirks mode or not&lt;br /&gt;
:For task 3 there are several different parts, but the main goal is to increase the complexity of our randomly generated pages.  First we will increase the tree depth to an arbitrary depth.  We will then generate sibling elements and increase the CSS styling options.  Finally, we will increase the amount of HTML elements that can be generated and randomly choose whether to generate a document in quirks mode or not.&lt;br /&gt;
:The code_generation.py file will be adapted to provide these functions. The function used to add random sections will have recursion added to generate elements within elements, resulting in a tree of html elements. The amounting of nesting will be random but limited. Within the sections, tables, lists, spans, and divs may potentially be created. This will involve writing new functions for creating each element, and allowing them to be chosen at random by the function that creates sections of the HTML document.&lt;br /&gt;
&lt;br /&gt;
==Testing==&lt;br /&gt;
Because of the nature of this project, testing the newly added features will be very simple. Task 2 actually involves us comparing screenshots.  By comparing the actual screenshots we will test that things work.  Additionally, we will be able to visually test that task 3 is complete (seeing that the new page generation features work).  While we could probably automate some of the testing for task 3 (to test all possible scenarios) it is out of the scope of this project.  &lt;br /&gt;
&lt;br /&gt;
==Conclusion==&lt;br /&gt;
The previously completed work allows us to generate simple html documents with a randomized structure, render the page in Servo, and take a screenshot of the page. We plan on furthering this work by rendering the pages in both Servo and Firefox, taking screenshots of the pages within both browsers, and reporting differences between the two. Doing so will allow users to evaluate Servo’s ability to load web pages. To make this testing even more informative, we plan to increase the complexity of the structure and styling of the randomly generated html documents.&lt;/div&gt;</summary>
		<author><name>Adsimps3</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2018-_Project_M1803:_Implement_a_web_page_fuzzer_to_find_rendering_mismatches_(Part_2)&amp;diff=116689</id>
		<title>CSC/ECE 517 Spring 2018- Project M1803: Implement a web page fuzzer to find rendering mismatches (Part 2)</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2018-_Project_M1803:_Implement_a_web_page_fuzzer_to_find_rendering_mismatches_(Part_2)&amp;diff=116689"/>
		<updated>2018-04-15T20:26:53Z</updated>

		<summary type="html">&lt;p&gt;Adsimps3: /* Work to be done */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;By Alexander Simpson(adsimps3), Abhay Soni (asoni3), Dileep badveli (dbadvel) and Jake Batty(jbatty)&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
This Mozilla project was broken in to 2 main parts: the initial and subsequent steps.  The initial steps were finished as a part of the OSS project.  The goal of this final project is to complete the subsequent steps.  As a part of the OSS project (explained more below) we created a tool which generates random valid HTML files and automated servo.  Now, as a part of this project we are supposed to extend the program to also control Firefox, compare the resulting screenshots, and expand upon the page generation tool.&lt;br /&gt;
&lt;br /&gt;
==Background==&lt;br /&gt;
TODO: explain servo&lt;br /&gt;
&lt;br /&gt;
==Previous Work (Part of the OSS Project)==&lt;br /&gt;
&lt;br /&gt;
As per the [https://github.com/servo/servo/wiki/Random-web-content-project project description], we were expected to complete the initial steps. The implementation is explained below for each of these steps.&lt;br /&gt;
&lt;br /&gt;
:1) In a new repository, create a program that can generate a skeleton HTML file with a doctype, head element, and body element, print the result to stdout&lt;br /&gt;
::- Here is the [https://github.com/asoni3/Random-web-content-generator---CSC-517-OSS-Project link] to the repository which contains code_generation.py file which will be used to generate random valid HTML files.&lt;br /&gt;
:2) Add a module to the program that enable generating random content specific to the &amp;lt;head&amp;gt; element (such as inline CSS content inside of a &amp;lt;style&amp;gt; element) and add it to the generated output&lt;br /&gt;
::- The file [https://github.com/asoni3/Random-web-content-generator---CSC-517-OSS-Project/blob/master/code_generation.py code_generation.py], contains the code which generates random content specific to the head element and adds style on top of it. As seen in this code, after generating random content to the file, we will add CSS elements on top of this content. We have established a list of commonly used styles, weights, fonts, font_styles, and alignments which will be used at random. For practical purposes, we are limiting the number of options.&lt;br /&gt;
:3) Add a module to the program that enables generating random content specific to the &amp;lt;body&amp;gt; element (such as a &amp;lt;p&amp;gt; block that contains randomly generated text) and add it to the generated output&lt;br /&gt;
:4) Generate simple random CSS that affects randomly generated content (ie. if there is an element with an id foo, generate a CSS selector like #foo that applies a style like colorto it)&lt;br /&gt;
:5) Create a program under Servo's etc/ that launches Servo and causes it to [https://github.com/servo/servo/wiki/Control-Servo-using-WebDriver take a screenshot] of a particular URL - use this to take screenshots of pages randomly generated by the previous program&lt;br /&gt;
:Sample Screenshot:&lt;br /&gt;
:[[File:Servoscreenshot.png|border]]&lt;br /&gt;
&lt;br /&gt;
==Work to be done==&lt;br /&gt;
Below is a list of the tasks to be done as a part of our final project.  Below each task we have described what we think it will take to complete the respective task.  &lt;br /&gt;
 &lt;br /&gt;
:'''1) Extend the program that controls Servo to also control Firefox using geckodriver'''&lt;br /&gt;
:Task 1 is relatively simple.  It just involves downloading geckodriver and running it.  Geckodriver is an open source software engine that allows us to render marked content on a web browser.  It should allow us to take screenshots of a particular URL just like task 5 in the previous work section.  &lt;br /&gt;
&lt;br /&gt;
:'''2) Compare the resulting screenshots and report the contents of the generated page if the screenshots differ'''&lt;br /&gt;
:This task involves automating Firefox to use geckodriver and the current servo program.  They both will create 2 different screenshots.  If servo and Firefox render it differently, we will report that file and mark the differences.  &lt;br /&gt;
:To actually make the comparisons we will use [https://opencv.org/ OpenCV].  OpenCV will allow us to not only make comparisons but will also mark where the differences in.  To actually do the comparisons we will first convert the images to grayscale and then call compare_ssim().  This will get us a score and diff values.  The score represents how close the to images are to each other and the diff tells us where the differences are.  If the score indicates that the images are different we will use the diff value to findContours() and then draw a rectangle around the differences.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
:'''3) Extend the page generation tool with a bunch of additional strategies, such as:'''&lt;br /&gt;
::-Generating elements trees of arbitrary depth&lt;br /&gt;
::-Generating sibling elements&lt;br /&gt;
::-Extending the set of CSS properties that can be generated (display, background, float, padding, margin, border, etc.)&lt;br /&gt;
::-Extending the set of elements that can be generated (span, div, header elements, table (and associated table contents), etc.)&lt;br /&gt;
::-Randomly choose whether to generate a document in quirks mode or not&lt;br /&gt;
:For task 3 there are several different parts, but the main goal is to increase the complexity of our randomly generated pages.  First we will increase the tree depth to an arbitrary depth.  We will then generate sibling elements and increase the CSS styling options.  Finally, we will increase the amount of HTML elements that can be generated and randomly choose whether to generate a document in quirks mode or not.&lt;br /&gt;
:The code_generation.py file will be adapted to provide these functions. The function used to add random sections will have recursion added to generate elements within elements, resulting in a tree of html elements. The amounting of nesting will be random but limited. Within the sections, tables, lists, spans, and divs may potentially be created. This will involve writing new functions for creating each element, and allowing them to be chosen at random by the function that creates sections of the HTML document.&lt;br /&gt;
&lt;br /&gt;
==Testing==&lt;br /&gt;
Because of the nature of this project, testing the newly added features will be very simple. Task 2 actually involves us comparing screenshots.  By comparing the actual screenshots we will test that things work.  Additionally, we will be able to visually test that task 3 is complete (seeing that the new page generation features work).  While we could probably automate some of the testing for task 3 (to test all possible scenarios) it is out of the scope of this project.  &lt;br /&gt;
&lt;br /&gt;
==Conclusion==&lt;br /&gt;
The previously completed work allows us to generate simple html documents with a randomized structure, render the page in Servo, and take a screenshot of the page. We plan on furthering this work by rendering the pages in both Servo and Firefox, taking screenshots of the pages within both browsers, and reporting differences between the two. Doing so will allow users to evaluate Servo’s ability to load web pages. To make this testing even more informative, we plan to increase the complexity of the structure and styling of the randomly generated html documents.&lt;/div&gt;</summary>
		<author><name>Adsimps3</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2018-_Project_M1803:_Implement_a_web_page_fuzzer_to_find_rendering_mismatches_(Part_2)&amp;diff=116687</id>
		<title>CSC/ECE 517 Spring 2018- Project M1803: Implement a web page fuzzer to find rendering mismatches (Part 2)</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2018-_Project_M1803:_Implement_a_web_page_fuzzer_to_find_rendering_mismatches_(Part_2)&amp;diff=116687"/>
		<updated>2018-04-15T20:07:30Z</updated>

		<summary type="html">&lt;p&gt;Adsimps3: /* Work to be done */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;By Alexander Simpson(adsimps3), Abhay Soni (asoni3), Dileep badveli (dbadvel) and Jake Batty(jbatty)&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
This Mozilla project was broken in to 2 main parts: the initial and subsequent steps.  The initial steps were finished as a part of the OSS project.  The goal of this final project is to complete the subsequent steps.  As a part of the OSS project (explained more below) we created a tool which generates random valid HTML files and automated servo.  Now, as a part of this project we are supposed to extend the program to also control Firefox, compare the resulting screenshots, and expand upon the page generation tool.&lt;br /&gt;
&lt;br /&gt;
==Background==&lt;br /&gt;
TODO: explain servo&lt;br /&gt;
&lt;br /&gt;
==Previous Work (Part of the OSS Project)==&lt;br /&gt;
&lt;br /&gt;
As per the [https://github.com/servo/servo/wiki/Random-web-content-project project description], we were expected to complete the initial steps. The implementation is explained below for each of these steps.&lt;br /&gt;
&lt;br /&gt;
:1) In a new repository, create a program that can generate a skeleton HTML file with a doctype, head element, and body element, print the result to stdout&lt;br /&gt;
::- Here is the [https://github.com/asoni3/Random-web-content-generator---CSC-517-OSS-Project link] to the repository which contains code_generation.py file which will be used to generate random valid HTML files.&lt;br /&gt;
:2) Add a module to the program that enable generating random content specific to the &amp;lt;head&amp;gt; element (such as inline CSS content inside of a &amp;lt;style&amp;gt; element) and add it to the generated output&lt;br /&gt;
::- The file [https://github.com/asoni3/Random-web-content-generator---CSC-517-OSS-Project/blob/master/code_generation.py code_generation.py], contains the code which generates random content specific to the head element and adds style on top of it. As seen in this code, after generating random content to the file, we will add CSS elements on top of this content. We have established a list of commonly used styles, weights, fonts, font_styles, and alignments which will be used at random. For practical purposes, we are limiting the number of options.&lt;br /&gt;
:3) Add a module to the program that enables generating random content specific to the &amp;lt;body&amp;gt; element (such as a &amp;lt;p&amp;gt; block that contains randomly generated text) and add it to the generated output&lt;br /&gt;
:4) Generate simple random CSS that affects randomly generated content (ie. if there is an element with an id foo, generate a CSS selector like #foo that applies a style like colorto it)&lt;br /&gt;
:5) Create a program under Servo's etc/ that launches Servo and causes it to [https://github.com/servo/servo/wiki/Control-Servo-using-WebDriver take a screenshot] of a particular URL - use this to take screenshots of pages randomly generated by the previous program&lt;br /&gt;
:Sample Screenshot:&lt;br /&gt;
:[[File:Servoscreenshot.png|border]]&lt;br /&gt;
&lt;br /&gt;
==Work to be done==&lt;br /&gt;
Below is a list of the tasks to be done as a part of our final project.  Below each task we have described what we think it will take to complete the respective task.  &lt;br /&gt;
 &lt;br /&gt;
:'''1) Extend the program that controls Servo to also control Firefox using geckodriver'''&lt;br /&gt;
:Task 1 is relatively simple.  It just involves downloading geckodriver and running it.  Geckodriver is an open source software engine that allows us to render marked content on a web browser.  It should allow us to take screenshots of a particular URL just like task 5 in the previous work section.  &lt;br /&gt;
&lt;br /&gt;
:'''2) Compare the resulting screenshots and report the contents of the generated page if the screenshots differ'''&lt;br /&gt;
:This task involves automating Firefox to use geckodriver and the current servo program.  They both will create 2 different screenshots.  If servo and Firefox render it differently, we will report that file and mark the differences.  &lt;br /&gt;
&lt;br /&gt;
:'''3) Extend the page generation tool with a bunch of additional strategies, such as:'''&lt;br /&gt;
::-Generating elements trees of arbitrary depth&lt;br /&gt;
::-Generating sibling elements&lt;br /&gt;
::-Extending the set of CSS properties that can be generated (display, background, float, padding, margin, border, etc.)&lt;br /&gt;
::-Extending the set of elements that can be generated (span, div, header elements, table (and associated table contents), etc.)&lt;br /&gt;
::-Randomly choose whether to generate a document in quirks mode or not&lt;br /&gt;
:For task 3 there are several different parts, but the main goal is to increase the complexity of our randomly generated pages.  First we will increase the tree depth to an arbitrary depth.  We will then generate sibling elements and increase the CSS styling options.  Finally, we will increase the amount of HTML elements that can be generated and randomly choose whether to generate a document in quirks mode or not.&lt;br /&gt;
:To actually make the changes to the page generation tool we will add code to the [https://github.com/asoni3/Random-web-content-generator---CSC-517-OSS-Project/blob/master/code_generation.py code_generation.py] file.&lt;br /&gt;
&lt;br /&gt;
==Testing==&lt;br /&gt;
Because of the nature of this project, testing the newly added features will be very simple. Task 2 actually involves us comparing screenshots.  By comparing the actual screenshots we will test that things work.  Additionally, we will be able to visually test that task 3 is complete (seeing that the new page generation features work).  While we could probably automate some of the testing for task 3 (to test all possible scenarios) it is out of the scope of this project.  &lt;br /&gt;
&lt;br /&gt;
==Conclusion==&lt;br /&gt;
The previously completed work allows us to generate simple html documents with a randomized structure, render the page in Servo, and take a screenshot of the page. We plan on furthering this work by rendering the pages in both Servo and Firefox, taking screenshots of the pages within both browsers, and reporting differences between the two. Doing so will allow users to evaluate Servo’s ability to load web pages. To make this testing even more informative, we plan to increase the complexity of the structure and styling of the randomly generated html documents.&lt;/div&gt;</summary>
		<author><name>Adsimps3</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2018-_Project_M1803:_Implement_a_web_page_fuzzer_to_find_rendering_mismatches_(Part_2)&amp;diff=116686</id>
		<title>CSC/ECE 517 Spring 2018- Project M1803: Implement a web page fuzzer to find rendering mismatches (Part 2)</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2018-_Project_M1803:_Implement_a_web_page_fuzzer_to_find_rendering_mismatches_(Part_2)&amp;diff=116686"/>
		<updated>2018-04-15T20:03:25Z</updated>

		<summary type="html">&lt;p&gt;Adsimps3: /* Work to be done */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;By Alexander Simpson(adsimps3), Abhay Soni (asoni3), Dileep badveli (dbadvel) and Jake Batty(jbatty)&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
This Mozilla project was broken in to 2 main parts: the initial and subsequent steps.  The initial steps were finished as a part of the OSS project.  The goal of this final project is to complete the subsequent steps.  As a part of the OSS project (explained more below) we created a tool which generates random valid HTML files and automated servo.  Now, as a part of this project we are supposed to extend the program to also control Firefox, compare the resulting screenshots, and expand upon the page generation tool.&lt;br /&gt;
&lt;br /&gt;
==Background==&lt;br /&gt;
TODO: explain servo&lt;br /&gt;
&lt;br /&gt;
==Previous Work (Part of the OSS Project)==&lt;br /&gt;
&lt;br /&gt;
As per the [https://github.com/servo/servo/wiki/Random-web-content-project project description], we were expected to complete the initial steps. The implementation is explained below for each of these steps.&lt;br /&gt;
&lt;br /&gt;
:1) In a new repository, create a program that can generate a skeleton HTML file with a doctype, head element, and body element, print the result to stdout&lt;br /&gt;
::- Here is the [https://github.com/asoni3/Random-web-content-generator---CSC-517-OSS-Project link] to the repository which contains code_generation.py file which will be used to generate random valid HTML files.&lt;br /&gt;
:2) Add a module to the program that enable generating random content specific to the &amp;lt;head&amp;gt; element (such as inline CSS content inside of a &amp;lt;style&amp;gt; element) and add it to the generated output&lt;br /&gt;
::- The file [https://github.com/asoni3/Random-web-content-generator---CSC-517-OSS-Project/blob/master/code_generation.py code_generation.py], contains the code which generates random content specific to the head element and adds style on top of it. As seen in this code, after generating random content to the file, we will add CSS elements on top of this content. We have established a list of commonly used styles, weights, fonts, font_styles, and alignments which will be used at random. For practical purposes, we are limiting the number of options.&lt;br /&gt;
:3) Add a module to the program that enables generating random content specific to the &amp;lt;body&amp;gt; element (such as a &amp;lt;p&amp;gt; block that contains randomly generated text) and add it to the generated output&lt;br /&gt;
:4) Generate simple random CSS that affects randomly generated content (ie. if there is an element with an id foo, generate a CSS selector like #foo that applies a style like colorto it)&lt;br /&gt;
:5) Create a program under Servo's etc/ that launches Servo and causes it to [https://github.com/servo/servo/wiki/Control-Servo-using-WebDriver take a screenshot] of a particular URL - use this to take screenshots of pages randomly generated by the previous program&lt;br /&gt;
:Sample Screenshot:&lt;br /&gt;
:[[File:Servoscreenshot.png|border]]&lt;br /&gt;
&lt;br /&gt;
==Work to be done==&lt;br /&gt;
Below is a list of the tasks to be done as a part of our final project.  Below each task we have described what we think it will take to complete the respective task.  &lt;br /&gt;
 &lt;br /&gt;
:'''1) Extend the program that controls Servo to also control Firefox using geckodriver'''&lt;br /&gt;
:Task 1 is relatively simple.  It just involves downloading geckodriver and running it.  Geckodriver is an open source software engine that allows us to render marked content on a web browser.  It should allow us to take screenshots of a particular URL just like task 5 in the previous work section.  &lt;br /&gt;
&lt;br /&gt;
:'''2) Compare the resulting screenshots and report the contents of the generated page if the screenshots differ'''&lt;br /&gt;
:This task involves automating Firefox to use geckodriver and the current servo program.  They both will create 2 different screenshots.  If servo and Firefox render it differently, we will report that file and mark the differences.  &lt;br /&gt;
&lt;br /&gt;
:'''3) Extend the page generation tool with a bunch of additional strategies, such as:'''&lt;br /&gt;
::-Generating elements trees of arbitrary depth&lt;br /&gt;
::-Generating sibling elements&lt;br /&gt;
::-Extending the set of CSS properties that can be generated (display, background, float, padding, margin, border, etc.)&lt;br /&gt;
::-Extending the set of elements that can be generated (span, div, header elements, table (and associated table contents), etc.)&lt;br /&gt;
::-Randomly choose whether to generate a document in quirks mode or not&lt;br /&gt;
:For task 3 there are several different parts, but the main goal is to increase the complexity of our randomly generated pages.  First we will increase the tree depth to an arbitrary depth.  We will then generate sibling elements and increase the CSS styling options.  Finally, we will increase the amount of HTML elements that can be generated and randomly choose whether to generate a document in quirks mode or not.&lt;br /&gt;
:To actually make the changes to the page generation tool we will add code to the [https://github.com/asoni3/Random-web-content-generator---CSC-517-OSS-Project/blob/master/code_generation.py code_generation.py] file.  We will add functions for most of the new randomly generated properties we are adding. For example,&lt;br /&gt;
&lt;br /&gt;
==Testing==&lt;br /&gt;
Because of the nature of this project, testing the newly added features will be very simple. Task 2 actually involves us comparing screenshots.  By comparing the actual screenshots we will test that things work.  Additionally, we will be able to visually test that task 3 is complete (seeing that the new page generation features work).  While we could probably automate some of the testing for task 3 (to test all possible scenarios) it is out of the scope of this project.  &lt;br /&gt;
&lt;br /&gt;
==Conclusion==&lt;br /&gt;
The previously completed work allows us to generate simple html documents with a randomized structure, render the page in Servo, and take a screenshot of the page. We plan on furthering this work by rendering the pages in both Servo and Firefox, taking screenshots of the pages within both browsers, and reporting differences between the two. Doing so will allow users to evaluate Servo’s ability to load web pages. To make this testing even more informative, we plan to increase the complexity of the structure and styling of the randomly generated html documents.&lt;/div&gt;</summary>
		<author><name>Adsimps3</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2018-_Project_M1803:_Implement_a_web_page_fuzzer_to_find_rendering_mismatches_(Part_2)&amp;diff=116685</id>
		<title>CSC/ECE 517 Spring 2018- Project M1803: Implement a web page fuzzer to find rendering mismatches (Part 2)</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2018-_Project_M1803:_Implement_a_web_page_fuzzer_to_find_rendering_mismatches_(Part_2)&amp;diff=116685"/>
		<updated>2018-04-15T19:57:56Z</updated>

		<summary type="html">&lt;p&gt;Adsimps3: /* Work to be done */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;By Alexander Simpson(adsimps3), Abhay Soni (asoni3), Dileep badveli (dbadvel) and Jake Batty(jbatty)&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
This Mozilla project was broken in to 2 main parts: the initial and subsequent steps.  The initial steps were finished as a part of the OSS project.  The goal of this final project is to complete the subsequent steps.  As a part of the OSS project (explained more below) we created a tool which generates random valid HTML files and automated servo.  Now, as a part of this project we are supposed to extend the program to also control Firefox, compare the resulting screenshots, and expand upon the page generation tool.&lt;br /&gt;
&lt;br /&gt;
==Background==&lt;br /&gt;
TODO: explain servo&lt;br /&gt;
&lt;br /&gt;
==Previous Work (Part of the OSS Project)==&lt;br /&gt;
&lt;br /&gt;
As per the [https://github.com/servo/servo/wiki/Random-web-content-project project description], we were expected to complete the initial steps. The implementation is explained below for each of these steps.&lt;br /&gt;
&lt;br /&gt;
:1) In a new repository, create a program that can generate a skeleton HTML file with a doctype, head element, and body element, print the result to stdout&lt;br /&gt;
::- Here is the [https://github.com/asoni3/Random-web-content-generator---CSC-517-OSS-Project link] to the repository which contains code_generation.py file which will be used to generate random valid HTML files.&lt;br /&gt;
:2) Add a module to the program that enable generating random content specific to the &amp;lt;head&amp;gt; element (such as inline CSS content inside of a &amp;lt;style&amp;gt; element) and add it to the generated output&lt;br /&gt;
::- The file [https://github.com/asoni3/Random-web-content-generator---CSC-517-OSS-Project/blob/master/code_generation.py code_generation.py], contains the code which generates random content specific to the head element and adds style on top of it. As seen in this code, after generating random content to the file, we will add CSS elements on top of this content. We have established a list of commonly used styles, weights, fonts, font_styles, and alignments which will be used at random. For practical purposes, we are limiting the number of options.&lt;br /&gt;
:3) Add a module to the program that enables generating random content specific to the &amp;lt;body&amp;gt; element (such as a &amp;lt;p&amp;gt; block that contains randomly generated text) and add it to the generated output&lt;br /&gt;
:4) Generate simple random CSS that affects randomly generated content (ie. if there is an element with an id foo, generate a CSS selector like #foo that applies a style like colorto it)&lt;br /&gt;
:5) Create a program under Servo's etc/ that launches Servo and causes it to [https://github.com/servo/servo/wiki/Control-Servo-using-WebDriver take a screenshot] of a particular URL - use this to take screenshots of pages randomly generated by the previous program&lt;br /&gt;
:Sample Screenshot:&lt;br /&gt;
:[[File:Servoscreenshot.png|border]]&lt;br /&gt;
&lt;br /&gt;
==Work to be done==&lt;br /&gt;
Below is a list of the tasks to be done as a part of our final project.  Below each task we have described what we think it will take to complete the respective task.  &lt;br /&gt;
 &lt;br /&gt;
:'''1) Extend the program that controls Servo to also control Firefox using geckodriver'''&lt;br /&gt;
:Task 1 is relatively simple.  It just involves downloading geckodriver and running it.  Geckodriver is an open source software engine that allows us to render marked content on a web browser.  It should allow us to take screenshots of a particular URL just like task 5 in the previous work section.  &lt;br /&gt;
&lt;br /&gt;
:'''2) Compare the resulting screenshots and report the contents of the generated page if the screenshots differ'''&lt;br /&gt;
:This task involves automating Firefox to use geckodriver and the current servo program.  They both will create 2 different screenshots.  If servo and Firefox render it differently, we will report that file and mark the differences.  &lt;br /&gt;
&lt;br /&gt;
:'''3) Extend the page generation tool with a bunch of additional strategies, such as:'''&lt;br /&gt;
::-Generating elements trees of arbitrary depth&lt;br /&gt;
::-Generating sibling elements&lt;br /&gt;
::-Extending the set of CSS properties that can be generated (display, background, float, padding, margin, border, etc.)&lt;br /&gt;
::-Extending the set of elements that can be generated (span, div, header elements, table (and associated table contents), etc.)&lt;br /&gt;
::-Randomly choose whether to generate a document in quirks mode or not&lt;br /&gt;
:For task 3 there are several different parts, but the main goal is to increase the complexity of our randomly generated pages.  First we will increase the tree depth to an arbitrary depth.  We will then generate sibling elements and increase the CSS styling options.  Finally, we will increase the amount of HTML elements that can be generated and randomly choose whether to generate a document in quirks mode or not.&lt;br /&gt;
:To actually make the changes to the page generation tool we will add code to the [https://github.com/asoni3/Random-web-content-generator---CSC-517-OSS-Project/blob/master/code_generation.py code_generation.py] file.&lt;br /&gt;
&lt;br /&gt;
==Testing==&lt;br /&gt;
Because of the nature of this project, testing the newly added features will be very simple. Task 2 actually involves us comparing screenshots.  By comparing the actual screenshots we will test that things work.  Additionally, we will be able to visually test that task 3 is complete (seeing that the new page generation features work).  While we could probably automate some of the testing for task 3 (to test all possible scenarios) it is out of the scope of this project.  &lt;br /&gt;
&lt;br /&gt;
==Conclusion==&lt;br /&gt;
The previously completed work allows us to generate simple html documents with a randomized structure, render the page in Servo, and take a screenshot of the page. We plan on furthering this work by rendering the pages in both Servo and Firefox, taking screenshots of the pages within both browsers, and reporting differences between the two. Doing so will allow users to evaluate Servo’s ability to load web pages. To make this testing even more informative, we plan to increase the complexity of the structure and styling of the randomly generated html documents.&lt;/div&gt;</summary>
		<author><name>Adsimps3</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2018-_Project_M1803:_Implement_a_web_page_fuzzer_to_find_rendering_mismatches_(Part_2)&amp;diff=116684</id>
		<title>CSC/ECE 517 Spring 2018- Project M1803: Implement a web page fuzzer to find rendering mismatches (Part 2)</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2018-_Project_M1803:_Implement_a_web_page_fuzzer_to_find_rendering_mismatches_(Part_2)&amp;diff=116684"/>
		<updated>2018-04-15T19:56:23Z</updated>

		<summary type="html">&lt;p&gt;Adsimps3: /* Work to be done */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;By Alexander Simpson(adsimps3), Abhay Soni (asoni3), Dileep badveli (dbadvel) and Jake Batty(jbatty)&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
This Mozilla project was broken in to 2 main parts: the initial and subsequent steps.  The initial steps were finished as a part of the OSS project.  The goal of this final project is to complete the subsequent steps.  As a part of the OSS project (explained more below) we created a tool which generates random valid HTML files and automated servo.  Now, as a part of this project we are supposed to extend the program to also control Firefox, compare the resulting screenshots, and expand upon the page generation tool.&lt;br /&gt;
&lt;br /&gt;
==Background==&lt;br /&gt;
TODO: explain servo&lt;br /&gt;
&lt;br /&gt;
==Previous Work (Part of the OSS Project)==&lt;br /&gt;
&lt;br /&gt;
As per the [https://github.com/servo/servo/wiki/Random-web-content-project project description], we were expected to complete the initial steps. The implementation is explained below for each of these steps.&lt;br /&gt;
&lt;br /&gt;
:1) In a new repository, create a program that can generate a skeleton HTML file with a doctype, head element, and body element, print the result to stdout&lt;br /&gt;
::- Here is the [https://github.com/asoni3/Random-web-content-generator---CSC-517-OSS-Project link] to the repository which contains code_generation.py file which will be used to generate random valid HTML files.&lt;br /&gt;
:2) Add a module to the program that enable generating random content specific to the &amp;lt;head&amp;gt; element (such as inline CSS content inside of a &amp;lt;style&amp;gt; element) and add it to the generated output&lt;br /&gt;
::- The file [https://github.com/asoni3/Random-web-content-generator---CSC-517-OSS-Project/blob/master/code_generation.py code_generation.py], contains the code which generates random content specific to the head element and adds style on top of it. As seen in this code, after generating random content to the file, we will add CSS elements on top of this content. We have established a list of commonly used styles, weights, fonts, font_styles, and alignments which will be used at random. For practical purposes, we are limiting the number of options.&lt;br /&gt;
:3) Add a module to the program that enables generating random content specific to the &amp;lt;body&amp;gt; element (such as a &amp;lt;p&amp;gt; block that contains randomly generated text) and add it to the generated output&lt;br /&gt;
:4) Generate simple random CSS that affects randomly generated content (ie. if there is an element with an id foo, generate a CSS selector like #foo that applies a style like colorto it)&lt;br /&gt;
:5) Create a program under Servo's etc/ that launches Servo and causes it to [https://github.com/servo/servo/wiki/Control-Servo-using-WebDriver take a screenshot] of a particular URL - use this to take screenshots of pages randomly generated by the previous program&lt;br /&gt;
:Sample Screenshot:&lt;br /&gt;
:[[File:Servoscreenshot.png|border]]&lt;br /&gt;
&lt;br /&gt;
==Work to be done==&lt;br /&gt;
Below is a list of the tasks to be done as a part of our final project.  Below each task we have described what we think it will take to complete the respective task.  &lt;br /&gt;
 &lt;br /&gt;
:'''1) Extend the program that controls Servo to also control Firefox using geckodriver'''&lt;br /&gt;
:Task 1 is relatively simple.  It just involves downloading geckodriver and running it.  Geckodriver is an open source software engine that allows us to render marked content on a web browser.  It should allow us to take screenshots of a particular URL just like task 5 in the previous work section.  &lt;br /&gt;
&lt;br /&gt;
:'''2) Compare the resulting screenshots and report the contents of the generated page if the screenshots differ'''&lt;br /&gt;
:This task involves automating Firefox to use geckodriver and the current servo program.  They both will create 2 different screenshots.  If servo and Firefox render it differently, we will report that file and mark the differences.  &lt;br /&gt;
&lt;br /&gt;
:'''3) Extend the page generation tool with a bunch of additional strategies, such as:'''&lt;br /&gt;
::-Generating elements trees of arbitrary depth&lt;br /&gt;
::-Generating sibling elements&lt;br /&gt;
::-Extending the set of CSS properties that can be generated (display, background, float, padding, margin, border, etc.)&lt;br /&gt;
::-Extending the set of elements that can be generated (span, div, header elements, table (and associated table contents), etc.)&lt;br /&gt;
::-Randomly choose whether to generate a document in quirks mode or not&lt;br /&gt;
:For task 3 there are several different parts, but the main goal is to increase the complexity of our randomly generated pages.  First we will increase the tree depth to an arbitrary depth.  We will then generate sibling elements and increase the CSS styling options.  Finally, we will increase the amount of HTML elements that can be generated and randomly choose whether to generate a document in quirks mode or not.&lt;br /&gt;
&lt;br /&gt;
To actually make the changes to the page generation tool we will add code to the [https://github.com/asoni3/Random-web-content-generator---CSC-517-OSS-Project/blob/master/code_generation.py]&lt;br /&gt;
&lt;br /&gt;
==Testing==&lt;br /&gt;
Because of the nature of this project, testing the newly added features will be very simple. Task 2 actually involves us comparing screenshots.  By comparing the actual screenshots we will test that things work.  Additionally, we will be able to visually test that task 3 is complete (seeing that the new page generation features work).  While we could probably automate some of the testing for task 3 (to test all possible scenarios) it is out of the scope of this project.  &lt;br /&gt;
&lt;br /&gt;
==Conclusion==&lt;br /&gt;
The previously completed work allows us to generate simple html documents with a randomized structure, render the page in Servo, and take a screenshot of the page. We plan on furthering this work by rendering the pages in both Servo and Firefox, taking screenshots of the pages within both browsers, and reporting differences between the two. Doing so will allow users to evaluate Servo’s ability to load web pages. To make this testing even more informative, we plan to increase the complexity of the structure and styling of the randomly generated html documents.&lt;/div&gt;</summary>
		<author><name>Adsimps3</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2018-_Project_M1803:_Implement_a_web_page_fuzzer_to_find_rendering_mismatches_(Part_2)&amp;diff=116683</id>
		<title>CSC/ECE 517 Spring 2018- Project M1803: Implement a web page fuzzer to find rendering mismatches (Part 2)</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2018-_Project_M1803:_Implement_a_web_page_fuzzer_to_find_rendering_mismatches_(Part_2)&amp;diff=116683"/>
		<updated>2018-04-15T19:53:16Z</updated>

		<summary type="html">&lt;p&gt;Adsimps3: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;By Alexander Simpson(adsimps3), Abhay Soni (asoni3), Dileep badveli (dbadvel) and Jake Batty(jbatty)&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
This Mozilla project was broken in to 2 main parts: the initial and subsequent steps.  The initial steps were finished as a part of the OSS project.  The goal of this final project is to complete the subsequent steps.  As a part of the OSS project (explained more below) we created a tool which generates random valid HTML files and automated servo.  Now, as a part of this project we are supposed to extend the program to also control Firefox, compare the resulting screenshots, and expand upon the page generation tool.&lt;br /&gt;
&lt;br /&gt;
==Background==&lt;br /&gt;
TODO: explain servo&lt;br /&gt;
&lt;br /&gt;
==Previous Work (Part of the OSS Project)==&lt;br /&gt;
&lt;br /&gt;
As per the [https://github.com/servo/servo/wiki/Random-web-content-project project description], we were expected to complete the initial steps. The implementation is explained below for each of these steps.&lt;br /&gt;
&lt;br /&gt;
:1) In a new repository, create a program that can generate a skeleton HTML file with a doctype, head element, and body element, print the result to stdout&lt;br /&gt;
::- Here is the [https://github.com/asoni3/Random-web-content-generator---CSC-517-OSS-Project link] to the repository which contains code_generation.py file which will be used to generate random valid HTML files.&lt;br /&gt;
:2) Add a module to the program that enable generating random content specific to the &amp;lt;head&amp;gt; element (such as inline CSS content inside of a &amp;lt;style&amp;gt; element) and add it to the generated output&lt;br /&gt;
::- The file [https://github.com/asoni3/Random-web-content-generator---CSC-517-OSS-Project/blob/master/code_generation.py code_generation.py], contains the code which generates random content specific to the head element and adds style on top of it. As seen in this code, after generating random content to the file, we will add CSS elements on top of this content. We have established a list of commonly used styles, weights, fonts, font_styles, and alignments which will be used at random. For practical purposes, we are limiting the number of options.&lt;br /&gt;
:3) Add a module to the program that enables generating random content specific to the &amp;lt;body&amp;gt; element (such as a &amp;lt;p&amp;gt; block that contains randomly generated text) and add it to the generated output&lt;br /&gt;
:4) Generate simple random CSS that affects randomly generated content (ie. if there is an element with an id foo, generate a CSS selector like #foo that applies a style like colorto it)&lt;br /&gt;
:5) Create a program under Servo's etc/ that launches Servo and causes it to [https://github.com/servo/servo/wiki/Control-Servo-using-WebDriver take a screenshot] of a particular URL - use this to take screenshots of pages randomly generated by the previous program&lt;br /&gt;
:Sample Screenshot:&lt;br /&gt;
:[[File:Servoscreenshot.png|border]]&lt;br /&gt;
&lt;br /&gt;
==Work to be done==&lt;br /&gt;
Below is a list of the tasks to be done as a part of our final project.  Below each task we have described what we think it will take to complete the respective task.  &lt;br /&gt;
 &lt;br /&gt;
:'''1) Extend the program that controls Servo to also control Firefox using geckodriver'''&lt;br /&gt;
:Task 1 is relatively simple.  It just involves downloading geckodriver and running it.  Geckodriver is an open source software engine that allows us to render marked content on a web browser.  It should allow us to take screenshots of a particular URL just like task 5 in the previous work section.  &lt;br /&gt;
&lt;br /&gt;
:'''2) Compare the resulting screenshots and report the contents of the generated page if the screenshots differ'''&lt;br /&gt;
:This task involves automating Firefox to use geckodriver and the current servo program.  They both will create 2 different screenshots.  If servo and Firefox render it differently, we will report that file and mark the differences.  &lt;br /&gt;
&lt;br /&gt;
:'''3) Extend the page generation tool with a bunch of additional strategies, such as:'''&lt;br /&gt;
::-Generating elements trees of arbitrary depth&lt;br /&gt;
::-Generating sibling elements&lt;br /&gt;
::-Extending the set of CSS properties that can be generated (display, background, float, padding, margin, border, etc.)&lt;br /&gt;
::-Extending the set of elements that can be generated (span, div, header elements, table (and associated table contents), etc.)&lt;br /&gt;
::-Randomly choose whether to generate a document in quirks mode or not&lt;br /&gt;
:For task 3 there are several different parts, but the main goal is to increase the complexity of our randomly generated pages.  First we will increase the tree depth to an arbitrary depth.  We will then generate sibling elements and increase the CSS styling options.  Finally, we will increase the amount of HTML elements that can be generated and randomly choose whether to generate a document in quirks mode or not.&lt;br /&gt;
&lt;br /&gt;
==Testing==&lt;br /&gt;
Because of the nature of this project, testing the newly added features will be very simple. Task 2 actually involves us comparing screenshots.  By comparing the actual screenshots we will test that things work.  Additionally, we will be able to visually test that task 3 is complete (seeing that the new page generation features work).  While we could probably automate some of the testing for task 3 (to test all possible scenarios) it is out of the scope of this project.  &lt;br /&gt;
&lt;br /&gt;
==Conclusion==&lt;br /&gt;
The previously completed work allows us to generate simple html documents with a randomized structure, render the page in Servo, and take a screenshot of the page. We plan on furthering this work by rendering the pages in both Servo and Firefox, taking screenshots of the pages within both browsers, and reporting differences between the two. Doing so will allow users to evaluate Servo’s ability to load web pages. To make this testing even more informative, we plan to increase the complexity of the structure and styling of the randomly generated html documents.&lt;/div&gt;</summary>
		<author><name>Adsimps3</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2018-_Project_M1803:_Implement_a_web_page_fuzzer_to_find_rendering_mismatches_(Part_2)&amp;diff=116682</id>
		<title>CSC/ECE 517 Spring 2018- Project M1803: Implement a web page fuzzer to find rendering mismatches (Part 2)</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2018-_Project_M1803:_Implement_a_web_page_fuzzer_to_find_rendering_mismatches_(Part_2)&amp;diff=116682"/>
		<updated>2018-04-15T19:46:51Z</updated>

		<summary type="html">&lt;p&gt;Adsimps3: /* Introduction */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;By Alexander Simpson(adsimps3), Abhay Soni (asoni3), Dileep badveli (dbadvel) and Jake Batty(jbatty)&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
This Mozilla project was broken in to 2 main parts: the initial and subsequent steps.  The initial steps were finished as a part of the OSS project.  The goal of this final project is to complete the subsequent steps.  As a part of the OSS project (explained more below) we created a tool which generates random valid HTML files and automated servo.  Now, as a part of this project we are supposed to extend the program to also control Firefox, compare the resulting screenshots, and expand upon the page generation tool.&lt;br /&gt;
&lt;br /&gt;
==Background==&lt;br /&gt;
TODO: explain servo&lt;br /&gt;
&lt;br /&gt;
==Previous Work (Part of the OSS Project)==&lt;br /&gt;
&lt;br /&gt;
As per the [https://github.com/servo/servo/wiki/Random-web-content-project project description], we were expected to complete the initial steps. The implementation is explained below for each of these steps.&lt;br /&gt;
&lt;br /&gt;
:1) In a new repository, create a program that can generate a skeleton HTML file with a doctype, head element, and body element, print the result to stdout&lt;br /&gt;
::- Here is the [https://github.com/asoni3/Random-web-content-generator---CSC-517-OSS-Project link] to the repository which contains code_generation.py file which will be used to generate random valid HTML files.&lt;br /&gt;
:2) Add a module to the program that enable generating random content specific to the &amp;lt;head&amp;gt; element (such as inline CSS content inside of a &amp;lt;style&amp;gt; element) and add it to the generated output&lt;br /&gt;
::- The file [https://github.com/asoni3/Random-web-content-generator---CSC-517-OSS-Project/blob/master/code_generation.py code_generation.py], contains the code which generates random content specific to the head element and adds style on top of it. As seen in this code, after generating random content to the file, we will add CSS elements on top of this content. We have established a list of commonly used styles, weights, fonts, font_styles, and alignments which will be used at random. For practical purposes, we are limiting the number of options.&lt;br /&gt;
:3) Add a module to the program that enables generating random content specific to the &amp;lt;body&amp;gt; element (such as a &amp;lt;p&amp;gt; block that contains randomly generated text) and add it to the generated output&lt;br /&gt;
:4) Generate simple random CSS that affects randomly generated content (ie. if there is an element with an id foo, generate a CSS selector like #foo that applies a style like colorto it)&lt;br /&gt;
:5) Create a program under Servo's etc/ that launches Servo and causes it to [https://github.com/servo/servo/wiki/Control-Servo-using-WebDriver take a screenshot] of a particular URL - use this to take screenshots of pages randomly generated by the previous program&lt;br /&gt;
:Sample Screenshot:&lt;br /&gt;
:[[File:Servoscreenshot.png|border]]&lt;br /&gt;
&lt;br /&gt;
==Work to be done==&lt;br /&gt;
Below is a list of the tasks to be done as a part of our final project.  Below each task we have described what we think it will take to complete the respective task.  &lt;br /&gt;
 &lt;br /&gt;
:'''1) Extend the program that controls Servo to also control Firefox using geckodriver'''&lt;br /&gt;
:Task 1 is relatively simple.  It just involves downloading geckodriver and running it.  Geckodriver is an open source software engine that allows us to render marked content on a web browser.  It should allow us to take screenshots of a particular URL just like task 5 in the previous work section.  &lt;br /&gt;
&lt;br /&gt;
:'''2) Compare the resulting screenshots and report the contents of the generated page if the screenshots differ'''&lt;br /&gt;
:This task involves automating Firefox to use geckodriver and the current servo program.  They both will create 2 different screenshots.  If servo and Firefox render it differently, we will report that file and mark the differences.  &lt;br /&gt;
&lt;br /&gt;
:'''3) Extend the page generation tool with a bunch of additional strategies, such as:'''&lt;br /&gt;
::-Generating elements trees of arbitrary depth&lt;br /&gt;
::-Generating sibling elements&lt;br /&gt;
::-Extending the set of CSS properties that can be generated (display, background, float, padding, margin, border, etc.)&lt;br /&gt;
::-Extending the set of elements that can be generated (span, div, header elements, table (and associated table contents), etc.)&lt;br /&gt;
::-Randomly choose whether to generate a document in quirks mode or not&lt;br /&gt;
:For task 3 there are several different parts, but the main goal is to increase the complexity of our randomly generated pages.  First we will increase the tree depth to an arbitrary depth.  We will then generate sibling elements and increase the CSS styling options.  Finally, we will increase the amount of HTML elements that can be generated and randomly choose whether to generate a document in quirks mode or not.&lt;br /&gt;
&lt;br /&gt;
==Conclusion==&lt;br /&gt;
The previously completed work allows us to generate simple html documents with a randomized structure, render the page in Servo, and take a screenshot of the page. We plan on furthering this work by rendering the pages in both Servo and Firefox, taking screenshots of the pages within both browsers, and reporting differences between the two. Doing so will allow users to evaluate Servo’s ability to load web pages. To make this testing even more informative, we plan to increase the complexity of the structure and styling of the randomly generated html documents.&lt;/div&gt;</summary>
		<author><name>Adsimps3</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2018-_Project_M1803:_Implement_a_web_page_fuzzer_to_find_rendering_mismatches_(Part_2)&amp;diff=116681</id>
		<title>CSC/ECE 517 Spring 2018- Project M1803: Implement a web page fuzzer to find rendering mismatches (Part 2)</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2018-_Project_M1803:_Implement_a_web_page_fuzzer_to_find_rendering_mismatches_(Part_2)&amp;diff=116681"/>
		<updated>2018-04-15T19:46:22Z</updated>

		<summary type="html">&lt;p&gt;Adsimps3: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;By Alexander Simpson(adsimps3), Abhay Soni (asoni3), Dileep badveli (dbadvel) and Jake Batty(jbatty)&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
This Mozilla project was broken in to 2 main parts: the initial and subsequent steps.  The initial steps were finished as a part of the OSS project.  So the goal of this final project is to complete the subsequent steps.  As a part of the OSS project (explained more below) we created a tool which generates random valid HTML files and automated servo.  Now, as a part of this project we are supposed to extend the program to also control Firefox, compare the resulting screenshots, and expand upon the page generation tool.&lt;br /&gt;
&lt;br /&gt;
==Background==&lt;br /&gt;
TODO: explain servo&lt;br /&gt;
&lt;br /&gt;
==Previous Work (Part of the OSS Project)==&lt;br /&gt;
&lt;br /&gt;
As per the [https://github.com/servo/servo/wiki/Random-web-content-project project description], we were expected to complete the initial steps. The implementation is explained below for each of these steps.&lt;br /&gt;
&lt;br /&gt;
:1) In a new repository, create a program that can generate a skeleton HTML file with a doctype, head element, and body element, print the result to stdout&lt;br /&gt;
::- Here is the [https://github.com/asoni3/Random-web-content-generator---CSC-517-OSS-Project link] to the repository which contains code_generation.py file which will be used to generate random valid HTML files.&lt;br /&gt;
:2) Add a module to the program that enable generating random content specific to the &amp;lt;head&amp;gt; element (such as inline CSS content inside of a &amp;lt;style&amp;gt; element) and add it to the generated output&lt;br /&gt;
::- The file [https://github.com/asoni3/Random-web-content-generator---CSC-517-OSS-Project/blob/master/code_generation.py code_generation.py], contains the code which generates random content specific to the head element and adds style on top of it. As seen in this code, after generating random content to the file, we will add CSS elements on top of this content. We have established a list of commonly used styles, weights, fonts, font_styles, and alignments which will be used at random. For practical purposes, we are limiting the number of options.&lt;br /&gt;
:3) Add a module to the program that enables generating random content specific to the &amp;lt;body&amp;gt; element (such as a &amp;lt;p&amp;gt; block that contains randomly generated text) and add it to the generated output&lt;br /&gt;
:4) Generate simple random CSS that affects randomly generated content (ie. if there is an element with an id foo, generate a CSS selector like #foo that applies a style like colorto it)&lt;br /&gt;
:5) Create a program under Servo's etc/ that launches Servo and causes it to [https://github.com/servo/servo/wiki/Control-Servo-using-WebDriver take a screenshot] of a particular URL - use this to take screenshots of pages randomly generated by the previous program&lt;br /&gt;
:Sample Screenshot:&lt;br /&gt;
:[[File:Servoscreenshot.png|border]]&lt;br /&gt;
&lt;br /&gt;
==Work to be done==&lt;br /&gt;
Below is a list of the tasks to be done as a part of our final project.  Below each task we have described what we think it will take to complete the respective task.  &lt;br /&gt;
 &lt;br /&gt;
:'''1) Extend the program that controls Servo to also control Firefox using geckodriver'''&lt;br /&gt;
:Task 1 is relatively simple.  It just involves downloading geckodriver and running it.  Geckodriver is an open source software engine that allows us to render marked content on a web browser.  It should allow us to take screenshots of a particular URL just like task 5 in the previous work section.  &lt;br /&gt;
&lt;br /&gt;
:'''2) Compare the resulting screenshots and report the contents of the generated page if the screenshots differ'''&lt;br /&gt;
:This task involves automating Firefox to use geckodriver and the current servo program.  They both will create 2 different screenshots.  If servo and Firefox render it differently, we will report that file and mark the differences.  &lt;br /&gt;
&lt;br /&gt;
:'''3) Extend the page generation tool with a bunch of additional strategies, such as:'''&lt;br /&gt;
::-Generating elements trees of arbitrary depth&lt;br /&gt;
::-Generating sibling elements&lt;br /&gt;
::-Extending the set of CSS properties that can be generated (display, background, float, padding, margin, border, etc.)&lt;br /&gt;
::-Extending the set of elements that can be generated (span, div, header elements, table (and associated table contents), etc.)&lt;br /&gt;
::-Randomly choose whether to generate a document in quirks mode or not&lt;br /&gt;
:For task 3 there are several different parts, but the main goal is to increase the complexity of our randomly generated pages.  First we will increase the tree depth to an arbitrary depth.  We will then generate sibling elements and increase the CSS styling options.  Finally, we will increase the amount of HTML elements that can be generated and randomly choose whether to generate a document in quirks mode or not.&lt;br /&gt;
&lt;br /&gt;
==Conclusion==&lt;br /&gt;
The previously completed work allows us to generate simple html documents with a randomized structure, render the page in Servo, and take a screenshot of the page. We plan on furthering this work by rendering the pages in both Servo and Firefox, taking screenshots of the pages within both browsers, and reporting differences between the two. Doing so will allow users to evaluate Servo’s ability to load web pages. To make this testing even more informative, we plan to increase the complexity of the structure and styling of the randomly generated html documents.&lt;/div&gt;</summary>
		<author><name>Adsimps3</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2018-_Project_M1803:_Implement_a_web_page_fuzzer_to_find_rendering_mismatches_(Part_2)&amp;diff=116680</id>
		<title>CSC/ECE 517 Spring 2018- Project M1803: Implement a web page fuzzer to find rendering mismatches (Part 2)</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2018-_Project_M1803:_Implement_a_web_page_fuzzer_to_find_rendering_mismatches_(Part_2)&amp;diff=116680"/>
		<updated>2018-04-15T19:45:50Z</updated>

		<summary type="html">&lt;p&gt;Adsimps3: /* Introduction */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;By Alexander Simpson(adsimps3), Abhay Soni (asoni3), Dileep badveli (dbadvel) and Jake Batty(jbatty)&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
This Mozilla project was broken in to 2 main parts: the initial and subsequent steps.  The initial steps were finished as a part of the OSS project.  So the goal of this final project is to complete the subsequent steps.  As a part of the OSS project (explained more below) we created a tool which generates random valid HTML files and automated servo.  Now, as a part of this project we are supposed to extend the program to also control Firefox, compare the resulting screenshots, and expand upon the page generation tool.&lt;br /&gt;
&lt;br /&gt;
==Previous Work (Part of the OSS Project)==&lt;br /&gt;
&lt;br /&gt;
As per the [https://github.com/servo/servo/wiki/Random-web-content-project project description], we were expected to complete the initial steps. The implementation is explained below for each of these steps.&lt;br /&gt;
&lt;br /&gt;
:1) In a new repository, create a program that can generate a skeleton HTML file with a doctype, head element, and body element, print the result to stdout&lt;br /&gt;
::- Here is the [https://github.com/asoni3/Random-web-content-generator---CSC-517-OSS-Project link] to the repository which contains code_generation.py file which will be used to generate random valid HTML files.&lt;br /&gt;
:2) Add a module to the program that enable generating random content specific to the &amp;lt;head&amp;gt; element (such as inline CSS content inside of a &amp;lt;style&amp;gt; element) and add it to the generated output&lt;br /&gt;
::- The file [https://github.com/asoni3/Random-web-content-generator---CSC-517-OSS-Project/blob/master/code_generation.py code_generation.py], contains the code which generates random content specific to the head element and adds style on top of it. As seen in this code, after generating random content to the file, we will add CSS elements on top of this content. We have established a list of commonly used styles, weights, fonts, font_styles, and alignments which will be used at random. For practical purposes, we are limiting the number of options.&lt;br /&gt;
:3) Add a module to the program that enables generating random content specific to the &amp;lt;body&amp;gt; element (such as a &amp;lt;p&amp;gt; block that contains randomly generated text) and add it to the generated output&lt;br /&gt;
:4) Generate simple random CSS that affects randomly generated content (ie. if there is an element with an id foo, generate a CSS selector like #foo that applies a style like colorto it)&lt;br /&gt;
:5) Create a program under Servo's etc/ that launches Servo and causes it to [https://github.com/servo/servo/wiki/Control-Servo-using-WebDriver take a screenshot] of a particular URL - use this to take screenshots of pages randomly generated by the previous program&lt;br /&gt;
:Sample Screenshot:&lt;br /&gt;
:[[File:Servoscreenshot.png|border]]&lt;br /&gt;
&lt;br /&gt;
==Work to be done==&lt;br /&gt;
Below is a list of the tasks to be done as a part of our final project.  Below each task we have described what we think it will take to complete the respective task.  &lt;br /&gt;
 &lt;br /&gt;
:'''1) Extend the program that controls Servo to also control Firefox using geckodriver'''&lt;br /&gt;
:Task 1 is relatively simple.  It just involves downloading geckodriver and running it.  Geckodriver is an open source software engine that allows us to render marked content on a web browser.  It should allow us to take screenshots of a particular URL just like task 5 in the previous work section.  &lt;br /&gt;
&lt;br /&gt;
:'''2) Compare the resulting screenshots and report the contents of the generated page if the screenshots differ'''&lt;br /&gt;
:This task involves automating Firefox to use geckodriver and the current servo program.  They both will create 2 different screenshots.  If servo and Firefox render it differently, we will report that file and mark the differences.  &lt;br /&gt;
&lt;br /&gt;
:'''3) Extend the page generation tool with a bunch of additional strategies, such as:'''&lt;br /&gt;
::-Generating elements trees of arbitrary depth&lt;br /&gt;
::-Generating sibling elements&lt;br /&gt;
::-Extending the set of CSS properties that can be generated (display, background, float, padding, margin, border, etc.)&lt;br /&gt;
::-Extending the set of elements that can be generated (span, div, header elements, table (and associated table contents), etc.)&lt;br /&gt;
::-Randomly choose whether to generate a document in quirks mode or not&lt;br /&gt;
:For task 3 there are several different parts, but the main goal is to increase the complexity of our randomly generated pages.  First we will increase the tree depth to an arbitrary depth.  We will then generate sibling elements and increase the CSS styling options.  Finally, we will increase the amount of HTML elements that can be generated and randomly choose whether to generate a document in quirks mode or not.&lt;br /&gt;
&lt;br /&gt;
==Conclusion==&lt;br /&gt;
The previously completed work allows us to generate simple html documents with a randomized structure, render the page in Servo, and take a screenshot of the page. We plan on furthering this work by rendering the pages in both Servo and Firefox, taking screenshots of the pages within both browsers, and reporting differences between the two. Doing so will allow users to evaluate Servo’s ability to load web pages. To make this testing even more informative, we plan to increase the complexity of the structure and styling of the randomly generated html documents.&lt;/div&gt;</summary>
		<author><name>Adsimps3</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2018-_Project_E1812:_on_the_fly_calc.rb&amp;diff=115740</id>
		<title>CSC/ECE 517 Spring 2018- Project E1812: on the fly calc.rb</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2018-_Project_E1812:_on_the_fly_calc.rb&amp;diff=115740"/>
		<updated>2018-04-03T00:44:31Z</updated>

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

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

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

		<summary type="html">&lt;p&gt;Adsimps3: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Adsimps3</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2018-_Project_E1812:_on_the_fly_calc.rb&amp;diff=115723</id>
		<title>CSC/ECE 517 Spring 2018- Project E1812: on the fly calc.rb</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2018-_Project_E1812:_on_the_fly_calc.rb&amp;diff=115723"/>
		<updated>2018-04-03T00:21:05Z</updated>

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

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

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

		<summary type="html">&lt;p&gt;Adsimps3: uploaded a new version of &amp;amp;quot;File:ONTHEFLYTESTRESULTS.png&amp;amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Adsimps3</name></author>
	</entry>
</feed>