<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="ro">
	<id>http://wiki.dcae.pub.ro/index.php?action=history&amp;feed=atom&amp;title=SDPT_Lab_4</id>
	<title>SDPT Lab 4 - Revizia istoricului</title>
	<link rel="self" type="application/atom+xml" href="http://wiki.dcae.pub.ro/index.php?action=history&amp;feed=atom&amp;title=SDPT_Lab_4"/>
	<link rel="alternate" type="text/html" href="http://wiki.dcae.pub.ro/index.php?title=SDPT_Lab_4&amp;action=history"/>
	<updated>2026-05-28T14:27:59Z</updated>
	<subtitle>Istoricul versiunilor pentru această pagină din wiki</subtitle>
	<generator>MediaWiki 1.35.14</generator>
	<entry>
		<id>http://wiki.dcae.pub.ro/index.php?title=SDPT_Lab_4&amp;diff=8299&amp;oldid=prev</id>
		<title>Rhobincu la 23 martie 2026 13:32</title>
		<link rel="alternate" type="text/html" href="http://wiki.dcae.pub.ro/index.php?title=SDPT_Lab_4&amp;diff=8299&amp;oldid=prev"/>
		<updated>2026-03-23T13:32:44Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left diff-editfont-monospace&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;ro&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Versiunea anterioară&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Versiunea de la data 23 martie 2026 13:32&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l10&quot; &gt;Linia 10:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Linia 10:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* Simulate hardware interactions using Google Mock (GMock).&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* Simulate hardware interactions using Google Mock (GMock).&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* Generate interactive HTML Code Coverage reports using &amp;lt;code&amp;gt;gcovr&amp;lt;/code&amp;gt;.&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* Generate interactive HTML Code Coverage reports using &amp;lt;code&amp;gt;gcovr&amp;lt;/code&amp;gt;.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;−&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== Part 1: Theoretical Reference ==&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== Part 1: Theoretical Reference ==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l54&quot; &gt;Linia 54:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Linia 53:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/pre&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/pre&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;+&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;=== 1.4 Official Documentation &amp;amp; Tutorials ===&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;+&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;When you get stuck on syntax or advanced features during the lab, refer to these official resources:&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;+&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;* &amp;#039;&amp;#039;&amp;#039;Google Test:&amp;#039;&amp;#039;&amp;#039; [https://google.github.io/googletest/primer.html Googletest Primer (Official Tutorial)]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;+&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;* &amp;#039;&amp;#039;&amp;#039;Google Mock:&amp;#039;&amp;#039;&amp;#039; [https://google.github.io/googletest/gmock_for_dummies.html gMock for Dummies] and the [https://google.github.io/googletest/reference/mocking.html Mocking Reference]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;+&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;* &amp;#039;&amp;#039;&amp;#039;CMake FetchContent:&amp;#039;&amp;#039;&amp;#039; [https://cmake.org/cmake/help/latest/module/FetchContent.html Official CMake FetchContent Documentation]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;+&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;* &amp;#039;&amp;#039;&amp;#039;Code Coverage (gcovr):&amp;#039;&amp;#039;&amp;#039; [https://gcovr.com/en/stable/guide.html gcovr User Guide]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== Part 2: The Challenges ==&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== Part 2: The Challenges ==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l124&quot; &gt;Linia 124:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Linia 129:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;}&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;}&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/pre&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/pre&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;−&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;=== Challenge 1: The Verification Build System (Estimated: 20 mins) ===&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;=== Challenge 1: The Verification Build System (Estimated: 20 mins) ===&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l137&quot; &gt;Linia 137:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Linia 141:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#039;&amp;#039;&amp;#039;Verification:&amp;#039;&amp;#039;&amp;#039; Run &amp;lt;code&amp;gt;cmake -DCMAKE_BUILD_TYPE=Debug ..&amp;lt;/code&amp;gt; inside your build folder. It must configure without errors and download GTest.&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#039;&amp;#039;&amp;#039;Verification:&amp;#039;&amp;#039;&amp;#039; Run &amp;lt;code&amp;gt;cmake -DCMAKE_BUILD_TYPE=Debug ..&amp;lt;/code&amp;gt; inside your build folder. It must configure without errors and download GTest.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;−&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;=== Challenge 2: Pure Math TDD (Estimated: 25 mins) ===&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;=== Challenge 2: Pure Math TDD (Estimated: 25 mins) ===&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l148&quot; &gt;Linia 148:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Linia 151:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# Compile and run &amp;lt;code&amp;gt;./unit_tests&amp;lt;/code&amp;gt;. (Watch it fail! This is the RED phase).&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# Compile and run &amp;lt;code&amp;gt;./unit_tests&amp;lt;/code&amp;gt;. (Watch it fail! This is the RED phase).&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# Refactor &amp;lt;code&amp;gt;OvenController.cpp&amp;lt;/code&amp;gt; to fix the integer division bug. Recompile. (Watch it pass! This is the GREEN phase).&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# Refactor &amp;lt;code&amp;gt;OvenController.cpp&amp;lt;/code&amp;gt; to fix the integer division bug. Recompile. (Watch it pass! This is the GREEN phase).&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;−&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;=== Challenge 3: Hardware Mocking (Estimated: 40 mins) ===&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;=== Challenge 3: Hardware Mocking (Estimated: 40 mins) ===&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l163&quot; &gt;Linia 163:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Linia 165:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;#* Program the mock to return exactly &amp;lt;code&amp;gt;250.0f&amp;lt;/code&amp;gt;.  &lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;#* Program the mock to return exactly &amp;lt;code&amp;gt;250.0f&amp;lt;/code&amp;gt;.  &lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;#* Run the test. It will FAIL due to Bug 1. Fix the production code so it triggers on `&amp;gt;=`.&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;#* Run the test. It will FAIL due to Bug 1. Fix the production code so it triggers on `&amp;gt;=`.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;−&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;=== Challenge 4: The Coverage Report (Estimated: 15 mins) ===&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;=== Challenge 4: The Coverage Report (Estimated: 15 mins) ===&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l170&quot; &gt;Linia 170:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Linia 171:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# Ensure you have run &amp;lt;code&amp;gt;./unit_tests&amp;lt;/code&amp;gt; at least once so the &amp;lt;code&amp;gt;.gcda&amp;lt;/code&amp;gt; files are generated.&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# Ensure you have run &amp;lt;code&amp;gt;./unit_tests&amp;lt;/code&amp;gt; at least once so the &amp;lt;code&amp;gt;.gcda&amp;lt;/code&amp;gt; files are generated.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# Run the &amp;lt;code&amp;gt;gcovr&amp;lt;/code&amp;gt; command provided in the Theoretical Reference section.&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# Run the &amp;lt;code&amp;gt;gcovr&amp;lt;/code&amp;gt; command provided in the Theoretical Reference section.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;−&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# Open the resulting &amp;lt;code&amp;gt;coverage.html&amp;lt;/code&amp;gt; file in your web browser.&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;+&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# Open the resulting &amp;lt;code&amp;gt;coverage.html&amp;lt;/code&amp;gt; file in your web browser&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;. Check that you have achieved 100% branch coverage&lt;/ins&gt;.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;−&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;&amp;#039;&amp;#039;&amp;#039;Verification:&amp;#039;&amp;#039;&amp;#039; Click on &lt;/del&gt;the &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;&amp;lt;code&amp;gt;OvenController.cpp&amp;lt;/code&amp;gt; file in the HTML report. You should see 100% line coverage and 100% branch coverage &lt;/del&gt;(&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;green lines&lt;/del&gt;). &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;If you have red lines, you are missing a test case!&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;+&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;== Submission and Evaluation (Moodle VPL) ==&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;+&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;For this lab, your work will be automatically graded by &lt;/ins&gt;the &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;Moodle Virtual Programming Lab &lt;/ins&gt;(&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;VPL&lt;/ins&gt;) &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;engine&lt;/ins&gt;.  &lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;+&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;#039;&amp;#039;&amp;#039;How to submit:&amp;#039;&amp;#039;&amp;#039;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;+&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;# Ensure your code compiles locally and all tests pass (Green).&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;+&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;# Do &amp;#039;&amp;#039;&amp;#039;NOT&amp;#039;&amp;#039;&amp;#039; upload your &amp;lt;code&amp;gt;build/&amp;lt;/code&amp;gt; directory or any generated HTML files.&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;+&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;# Select the following files from your workspace:&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;+&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;#* &amp;lt;code&amp;gt;CMakeLists.txt&amp;lt;/code&amp;gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;+&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;#* &amp;lt;code&amp;gt;include/ISensor.h&amp;lt;/code&amp;gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;+&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;#* &amp;lt;code&amp;gt;include/OvenController.h&amp;lt;/code&amp;gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;+&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;#* &amp;lt;code&amp;gt;src/OvenController.cpp&amp;lt;/code&amp;gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;+&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;#* &amp;lt;code&amp;gt;tests/test_oven.cpp&amp;lt;/code&amp;gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;+&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;# Package these files into a single &amp;lt;code&amp;gt;.zip&amp;lt;/code&amp;gt; archive (maintaining the folder structure).&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;+&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;# Go to the Lab 4 assignment on Moodle and upload your &amp;lt;code&amp;gt;.zip&amp;lt;/code&amp;gt; file into the VPL submission portal.&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;+&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;# Click the &amp;#039;&amp;#039;&amp;#039;Evaluate&amp;#039;&amp;#039;&amp;#039; button.&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;−&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;== Lab Evaluation ==&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;+&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;The VPL server will automatically compile your CMake project&lt;/ins&gt;, &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;execute &lt;/ins&gt;your &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;Google Tests, &lt;/ins&gt;and &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;run &lt;/ins&gt;&amp;lt;code&amp;gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;gcovr&lt;/ins&gt;&amp;lt;/code&amp;gt;. &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;Your grade will be calculated based on the number of passing &lt;/ins&gt;tests &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;and &lt;/ins&gt;the &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;percentage of &lt;/ins&gt;branch coverage &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;achieved&lt;/ins&gt;.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;−&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;To receive full credit&lt;/del&gt;, &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;call the professor/TA to &lt;/del&gt;your &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;workstation &lt;/del&gt;and &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;demonstrate:&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;−&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;# Run &lt;/del&gt;&amp;lt;code&amp;gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;./unit_tests&lt;/del&gt;&amp;lt;/code&amp;gt;. &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;All &lt;/del&gt;tests &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;must pass (Green).&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;−&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;# Show your test code, explaining how Dependency Injection allowed you to pass the &amp;lt;code&amp;gt;MockSensor&amp;lt;/code&amp;gt; into the controller.&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;−&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;# Open your &amp;lt;code&amp;gt;coverage.html&amp;lt;/code&amp;gt; report in &lt;/del&gt;the &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;browser, demonstrating 100% &lt;/del&gt;branch coverage &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;for the &amp;lt;code&amp;gt;OvenController.cpp&amp;lt;/code&amp;gt; file&lt;/del&gt;.&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Rhobincu</name></author>
	</entry>
	<entry>
		<id>http://wiki.dcae.pub.ro/index.php?title=SDPT_Lab_4&amp;diff=8298&amp;oldid=prev</id>
		<title>Rhobincu: Pagină nouă: = Lab 4: Software Verification - TDD, Mocking, and Code Coverage =  == Introduction == In traditional embedded systems, testing involves compiling code, flashing it to a board, and...</title>
		<link rel="alternate" type="text/html" href="http://wiki.dcae.pub.ro/index.php?title=SDPT_Lab_4&amp;diff=8298&amp;oldid=prev"/>
		<updated>2026-03-23T13:27:18Z</updated>

		<summary type="html">&lt;p&gt;Pagină nouă: = Lab 4: Software Verification - TDD, Mocking, and Code Coverage =  == Introduction == In traditional embedded systems, testing involves compiling code, flashing it to a board, and...&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Pagină nouă&lt;/b&gt;&lt;/p&gt;&lt;div&gt;= Lab 4: Software Verification - TDD, Mocking, and Code Coverage =&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
In traditional embedded systems, testing involves compiling code, flashing it to a board, and physically observing the hardware. This is slow, expensive, and scales poorly. Today, we implement &amp;quot;Shift-Left Testing.&amp;quot; We will verify our C++ logic on our Host PC using automated frameworks before it ever touches a microcontroller.&lt;br /&gt;
&lt;br /&gt;
=== Goals ===&lt;br /&gt;
* Integrate Google Test and Google Mock via CMake.&lt;br /&gt;
* Write Unit Tests using the AAA (Arrange, Act, Assert) pattern.&lt;br /&gt;
* Use Dependency Injection to decouple business logic from hardware registers.&lt;br /&gt;
* Simulate hardware interactions using Google Mock (GMock).&lt;br /&gt;
* Generate interactive HTML Code Coverage reports using &amp;lt;code&amp;gt;gcovr&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Part 1: Theoretical Reference ==&lt;br /&gt;
&amp;#039;&amp;#039;Use this section as a reference manual to complete the challenges in Part 2.&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
=== 1.1 Google Test &amp;amp; Mock Cheat Sheet ===&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Basic Assertions:&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;lt;code&amp;gt;EXPECT_EQ(actual, expected);&amp;lt;/code&amp;gt; (Non-fatal equality check)&lt;br /&gt;
* &amp;lt;code&amp;gt;EXPECT_FLOAT_EQ(actual, expected);&amp;lt;/code&amp;gt; (Safe float comparison)&lt;br /&gt;
* &amp;lt;code&amp;gt;EXPECT_TRUE(condition);&amp;lt;/code&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Mocking an Interface (GMock):&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class MockSensor : public ISensor {&lt;br /&gt;
public:&lt;br /&gt;
    // MOCK_METHOD(ReturnType, MethodName, (Arguments), (override));&lt;br /&gt;
    MOCK_METHOD(float, read_temperature, (), (override));&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Setting Mock Expectations:&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
MockSensor fake_sensor;&lt;br /&gt;
// Program the mock to return 45.0 exactly twice.&lt;br /&gt;
EXPECT_CALL(fake_sensor, read_temperature())&lt;br /&gt;
    .Times(2)&lt;br /&gt;
    .WillRepeatedly(testing::Return(45.0f));&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== 1.2 CMake Debug &amp;amp; Coverage Setup ===&lt;br /&gt;
Coverage mathematically requires a completely unoptimized binary mapping exactly to your source code lines.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
if(CMAKE_BUILD_TYPE STREQUAL &amp;quot;Debug&amp;quot;)&lt;br /&gt;
    target_compile_options(my_target PRIVATE -O0 -g --coverage)&lt;br /&gt;
    target_link_options(my_target PRIVATE --coverage)&lt;br /&gt;
endif()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== 1.3 Running gcovr ===&lt;br /&gt;
Execute this from inside your &amp;lt;code&amp;gt;build/&amp;lt;/code&amp;gt; directory after running the tests:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
gcovr -r ../ . --html --html-details -o coverage.html -e &amp;quot;.*_deps.*&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Part 2: The Challenges ==&lt;br /&gt;
&lt;br /&gt;
=== Setup: The Raw Materials ===&lt;br /&gt;
You are building the safety controller for an industrial oven. It must read temperatures from an I2C sensor and trigger a physical alarm if it overheats. &lt;br /&gt;
&lt;br /&gt;
Create a new workspace (&amp;lt;code&amp;gt;sdpt-lab4&amp;lt;/code&amp;gt;). Create &amp;lt;code&amp;gt;include/&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;src/&amp;lt;/code&amp;gt; directories. Populate them with these three files:&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;include/ISensor.h&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; (The Hardware Interface)&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#pragma once&lt;br /&gt;
&lt;br /&gt;
// Pure virtual interface. We DO NOT implement hardware logic here.&lt;br /&gt;
class ISensor {&lt;br /&gt;
public:&lt;br /&gt;
    virtual float read_temperature() = 0;&lt;br /&gt;
    virtual ~ISensor() = default;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;include/OvenController.h&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; (The Logic Module)&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#pragma once&lt;br /&gt;
#include &amp;quot;ISensor.h&amp;quot;&lt;br /&gt;
&lt;br /&gt;
class OvenController {&lt;br /&gt;
private:&lt;br /&gt;
    ISensor* temp_sensor;&lt;br /&gt;
    bool alarm_active;&lt;br /&gt;
    float max_safe_temp;&lt;br /&gt;
&lt;br /&gt;
public:&lt;br /&gt;
    // Constructor uses Dependency Injection!&lt;br /&gt;
    OvenController(ISensor* sensor, float safe_limit = 250.0f);&lt;br /&gt;
    &lt;br /&gt;
    void check_safety();&lt;br /&gt;
    bool is_alarm_active() const;&lt;br /&gt;
    &lt;br /&gt;
    // Pure math function&lt;br /&gt;
    static float raw_adc_to_celsius(int adc_value);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;src/OvenController.cpp&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; (The Buggy Implementation)&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#include &amp;quot;../include/OvenController.h&amp;quot;&lt;br /&gt;
&lt;br /&gt;
OvenController::OvenController(ISensor* sensor, float safe_limit) &lt;br /&gt;
    : temp_sensor(sensor), alarm_active(false), max_safe_temp(safe_limit) {}&lt;br /&gt;
&lt;br /&gt;
void OvenController::check_safety() {&lt;br /&gt;
    float current_temp = temp_sensor-&amp;gt;read_temperature();&lt;br /&gt;
    &lt;br /&gt;
    // BUG 1: It only triggers if STRICTLY greater. What if it equals the limit?&lt;br /&gt;
    if (current_temp &amp;gt; max_safe_temp) {&lt;br /&gt;
        alarm_active = true;&lt;br /&gt;
    } else {&lt;br /&gt;
        alarm_active = false;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
bool OvenController::is_alarm_active() const {&lt;br /&gt;
    return alarm_active;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
float OvenController::raw_adc_to_celsius(int adc_value) {&lt;br /&gt;
    // BUG 2: Integer division truncates the decimal! (e.g., 5/2 = 2, not 2.5)&lt;br /&gt;
    return (adc_value / 4095) * 330.0f; &lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Challenge 1: The Verification Build System (Estimated: 20 mins) ===&lt;br /&gt;
We need a build system that fetches Google Test and compiles our code with coverage instrumentation.&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Your Task:&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
# Create a &amp;lt;code&amp;gt;CMakeLists.txt&amp;lt;/code&amp;gt; in the root directory.&lt;br /&gt;
# Build a static library named &amp;lt;code&amp;gt;oven_lib&amp;lt;/code&amp;gt; containing &amp;lt;code&amp;gt;src/OvenController.cpp&amp;lt;/code&amp;gt;.&lt;br /&gt;
# Use &amp;lt;code&amp;gt;FetchContent&amp;lt;/code&amp;gt; to pull Google Test (&amp;lt;code&amp;gt;https://github.com/google/googletest.git&amp;lt;/code&amp;gt;, tag &amp;lt;code&amp;gt;v1.13.0&amp;lt;/code&amp;gt;).&lt;br /&gt;
# Create an executable named &amp;lt;code&amp;gt;unit_tests&amp;lt;/code&amp;gt;. (You will create &amp;lt;code&amp;gt;tests/test_oven.cpp&amp;lt;/code&amp;gt; in the next step).&lt;br /&gt;
# Link &amp;lt;code&amp;gt;oven_lib&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;gtest_main&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;gmock&amp;lt;/code&amp;gt; to your test executable.&lt;br /&gt;
# Add the CMake logic to inject &amp;lt;code&amp;gt;-O0 -g --coverage&amp;lt;/code&amp;gt; ONLY if the build type is &amp;quot;Debug&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Verification:&amp;#039;&amp;#039;&amp;#039; Run &amp;lt;code&amp;gt;cmake -DCMAKE_BUILD_TYPE=Debug ..&amp;lt;/code&amp;gt; inside your build folder. It must configure without errors and download GTest.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Challenge 2: Pure Math TDD (Estimated: 25 mins) ===&lt;br /&gt;
Let&amp;#039;s catch the integer division bug using the Red-Green-Refactor cycle.&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Your Task:&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
# Create a &amp;lt;code&amp;gt;tests/&amp;lt;/code&amp;gt; directory and a &amp;lt;code&amp;gt;tests/test_oven.cpp&amp;lt;/code&amp;gt; file.&lt;br /&gt;
# Include &amp;lt;code&amp;gt;&amp;lt;gtest/gtest.h&amp;gt;&amp;lt;/code&amp;gt; and your &amp;lt;code&amp;gt;OvenController.h&amp;lt;/code&amp;gt;.&lt;br /&gt;
# Write a &amp;lt;code&amp;gt;TEST(MathTest, ConvertsADCToCelsius)&amp;lt;/code&amp;gt;.&lt;br /&gt;
# Use &amp;lt;code&amp;gt;EXPECT_FLOAT_EQ&amp;lt;/code&amp;gt; to assert that an ADC value of &amp;lt;code&amp;gt;2047&amp;lt;/code&amp;gt; (roughly half of 4095) returns approximately &amp;lt;code&amp;gt;164.957f&amp;lt;/code&amp;gt;.&lt;br /&gt;
# Compile and run &amp;lt;code&amp;gt;./unit_tests&amp;lt;/code&amp;gt;. (Watch it fail! This is the RED phase).&lt;br /&gt;
# Refactor &amp;lt;code&amp;gt;OvenController.cpp&amp;lt;/code&amp;gt; to fix the integer division bug. Recompile. (Watch it pass! This is the GREEN phase).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Challenge 3: Hardware Mocking (Estimated: 40 mins) ===&lt;br /&gt;
We need to test &amp;lt;code&amp;gt;check_safety()&amp;lt;/code&amp;gt;, but we are on a PC. We have no I2C hardware. We must mock the &amp;lt;code&amp;gt;ISensor&amp;lt;/code&amp;gt;.&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Your Task:&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
# In your test file, include &amp;lt;code&amp;gt;&amp;lt;gmock/gmock.h&amp;gt;&amp;lt;/code&amp;gt;.&lt;br /&gt;
# Create a &amp;lt;code&amp;gt;MockSensor&amp;lt;/code&amp;gt; class that inherits from &amp;lt;code&amp;gt;ISensor&amp;lt;/code&amp;gt;. Use &amp;lt;code&amp;gt;MOCK_METHOD&amp;lt;/code&amp;gt; to mock &amp;lt;code&amp;gt;read_temperature&amp;lt;/code&amp;gt;.&lt;br /&gt;
# Write a &amp;lt;code&amp;gt;TEST(SafetyTest, TriggersAlarmOnOverheat)&amp;lt;/code&amp;gt;.&lt;br /&gt;
#* &amp;#039;&amp;#039;&amp;#039;Arrange:&amp;#039;&amp;#039;&amp;#039; Instantiate the MockSensor. Instantiate the OvenController, injecting the mock sensor into it with a safe limit of 250.0f.&lt;br /&gt;
#* &amp;#039;&amp;#039;&amp;#039;Expectation:&amp;#039;&amp;#039;&amp;#039; Program the mock to return &amp;lt;code&amp;gt;260.0f&amp;lt;/code&amp;gt; when called.&lt;br /&gt;
#* &amp;#039;&amp;#039;&amp;#039;Act:&amp;#039;&amp;#039;&amp;#039; Call &amp;lt;code&amp;gt;check_safety()&amp;lt;/code&amp;gt;.&lt;br /&gt;
#* &amp;#039;&amp;#039;&amp;#039;Assert:&amp;#039;&amp;#039;&amp;#039; Expect that &amp;lt;code&amp;gt;is_alarm_active()&amp;lt;/code&amp;gt; is true.&lt;br /&gt;
# Write a second test: &amp;lt;code&amp;gt;TEST(SafetyTest, TriggersAlarmExactlyAtLimit)&amp;lt;/code&amp;gt;. &lt;br /&gt;
#* Program the mock to return exactly &amp;lt;code&amp;gt;250.0f&amp;lt;/code&amp;gt;. &lt;br /&gt;
#* Run the test. It will FAIL due to Bug 1. Fix the production code so it triggers on `&amp;gt;=`.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Challenge 4: The Coverage Report (Estimated: 15 mins) ===&lt;br /&gt;
Did we test every branch of our code? Let&amp;#039;s prove it mathematically.&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Your Task:&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
# Ensure you have run &amp;lt;code&amp;gt;./unit_tests&amp;lt;/code&amp;gt; at least once so the &amp;lt;code&amp;gt;.gcda&amp;lt;/code&amp;gt; files are generated.&lt;br /&gt;
# Run the &amp;lt;code&amp;gt;gcovr&amp;lt;/code&amp;gt; command provided in the Theoretical Reference section.&lt;br /&gt;
# Open the resulting &amp;lt;code&amp;gt;coverage.html&amp;lt;/code&amp;gt; file in your web browser.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Verification:&amp;#039;&amp;#039;&amp;#039; Click on the &amp;lt;code&amp;gt;OvenController.cpp&amp;lt;/code&amp;gt; file in the HTML report. You should see 100% line coverage and 100% branch coverage (green lines). If you have red lines, you are missing a test case!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Lab Evaluation ==&lt;br /&gt;
To receive full credit, call the professor/TA to your workstation and demonstrate:&lt;br /&gt;
# Run &amp;lt;code&amp;gt;./unit_tests&amp;lt;/code&amp;gt;. All tests must pass (Green).&lt;br /&gt;
# Show your test code, explaining how Dependency Injection allowed you to pass the &amp;lt;code&amp;gt;MockSensor&amp;lt;/code&amp;gt; into the controller.&lt;br /&gt;
# Open your &amp;lt;code&amp;gt;coverage.html&amp;lt;/code&amp;gt; report in the browser, demonstrating 100% branch coverage for the &amp;lt;code&amp;gt;OvenController.cpp&amp;lt;/code&amp;gt; file.&lt;/div&gt;</summary>
		<author><name>Rhobincu</name></author>
	</entry>
</feed>