sh1k4ku commited on
Commit
6b6f0ae
·
verified ·
1 Parent(s): a5a4d86

Upload assignment2.html with huggingface_hub

Browse files
Files changed (1) hide show
  1. assignment2.html +6 -6
assignment2.html CHANGED
@@ -101,11 +101,11 @@
101
  </head>
102
  <body>
103
  <div class="wrap">
104
- <h1>Software Testing — Assignment 2</h1>
105
  <p class="muted">Answer all questions below. Q4 has an interactive playground. When you are done, export your answers as JSON at the bottom.</p>
106
 
107
  <!-- ============ Q1 ============ -->
108
- <h2>Q1 &nbsp;Extended Entry Decision Table <span class="pts">[6 pts] · single choice</span></h2>
109
  <p>Test the UNSW Lecture-Theatre Booking system with Decision-Table testing. The system evaluates multi-valued conditions across several inputs to decide whether a booking is Booked, Wait-listed, or Rejected. Rules are checked one by one and the <b>first matching rule</b> applies.</p>
110
 
111
  <h3>Input specification</h3>
@@ -148,18 +148,18 @@
148
  <pre id="reffn"></pre>
149
 
150
  <!-- ============ Q2 ============ -->
151
- <h2>Q2 &nbsp;Control-Flow Graph <span class="pts">[3 pts] · single choice</span></h2>
152
  <p>Draw the control-flow graph for <code>binary_search</code>. Below are four candidate CFGs, written as complete DOT graphs and rendered. Exactly one is correct — select it.</p>
153
  <div id="q2opts"></div>
154
 
155
  <!-- ============ Q3 ============ -->
156
- <h2>Q3 &nbsp;Loop-Boundary Test Cases <span class="pts">[3 pts] · fill in the blanks</span></h2>
157
  <p>Develop a test suite achieving loop-boundary coverage (loop runs 0, 1, and 2 times). Fill each circled blank. Recall <code>mid = int(round((top+bott)/2.0))</code>.</p>
158
  <p class="muted">Marking: each loop case = 1 mark; within a case, one wrong blank −0.5, two or more wrong −1.</p>
159
  <pre id="q3block"></pre>
160
 
161
  <!-- ============ Q4 ============ -->
162
- <h2>Q4 &nbsp;Fault-Based Testing: Plant a Bug and Catch It <span class="pts">[3 pts] · playground</span></h2>
163
  <p class="muted">The Q3 suite reaches loop-boundary coverage, but coverage does not guarantee fault detection. This question asks you to demonstrate that gap on the <code>binary_search</code> function above.</p>
164
  <p>(a) Introduce <b>exactly one</b> single-line bug into <code>binary_search</code> so that <b>all three Q3 tests still pass</b> (the bug is invisible to the Q3 suite).
165
  (b) Provide <b>one</b> extra test case — with <code>target</code>, <code>key</code>, the <b>original output</b>, and the <b>variant output</b> — that <b>distinguishes</b> the variant from the original (original passes it, variant fails).</p>
@@ -193,7 +193,7 @@
193
  </div>
194
 
195
  <!-- ============ Q5 ============ -->
196
- <h2>Q5 &nbsp;Halstead Programming Effort <span class="pts">[1 pt] · single choice</span></h2>
197
  <p>Calculate the Halstead <b>programming effort</b> for the following code (parentheses are not counted as operators):</p>
198
  <pre id="q5code"></pre>
199
  <div id="q5opts"></div>
 
101
  </head>
102
  <body>
103
  <div class="wrap">
104
+ <h1>Software Testing — Assignment 2 <span class="pts" style="font-size:13px">[15 marks total]</span></h1>
105
  <p class="muted">Answer all questions below. Q4 has an interactive playground. When you are done, export your answers as JSON at the bottom.</p>
106
 
107
  <!-- ============ Q1 ============ -->
108
+ <h2>Q1 &nbsp;Extended Entry Decision Table <span class="pts">[3 pts] · single choice</span></h2>
109
  <p>Test the UNSW Lecture-Theatre Booking system with Decision-Table testing. The system evaluates multi-valued conditions across several inputs to decide whether a booking is Booked, Wait-listed, or Rejected. Rules are checked one by one and the <b>first matching rule</b> applies.</p>
110
 
111
  <h3>Input specification</h3>
 
148
  <pre id="reffn"></pre>
149
 
150
  <!-- ============ Q2 ============ -->
151
+ <h2>Q2 &nbsp;Control-Flow Graph <span class="pts">[2 pts] · single choice</span></h2>
152
  <p>Draw the control-flow graph for <code>binary_search</code>. Below are four candidate CFGs, written as complete DOT graphs and rendered. Exactly one is correct — select it.</p>
153
  <div id="q2opts"></div>
154
 
155
  <!-- ============ Q3 ============ -->
156
+ <h2>Q3 &nbsp;Loop-Boundary Test Cases <span class="pts">[2 pts] · fill in the blanks</span></h2>
157
  <p>Develop a test suite achieving loop-boundary coverage (loop runs 0, 1, and 2 times). Fill each circled blank. Recall <code>mid = int(round((top+bott)/2.0))</code>.</p>
158
  <p class="muted">Marking: each loop case = 1 mark; within a case, one wrong blank −0.5, two or more wrong −1.</p>
159
  <pre id="q3block"></pre>
160
 
161
  <!-- ============ Q4 ============ -->
162
+ <h2>Q4 &nbsp;Fault-Based Testing: Plant a Bug and Catch It <span class="pts">[6 pts] · playground</span></h2>
163
  <p class="muted">The Q3 suite reaches loop-boundary coverage, but coverage does not guarantee fault detection. This question asks you to demonstrate that gap on the <code>binary_search</code> function above.</p>
164
  <p>(a) Introduce <b>exactly one</b> single-line bug into <code>binary_search</code> so that <b>all three Q3 tests still pass</b> (the bug is invisible to the Q3 suite).
165
  (b) Provide <b>one</b> extra test case — with <code>target</code>, <code>key</code>, the <b>original output</b>, and the <b>variant output</b> — that <b>distinguishes</b> the variant from the original (original passes it, variant fails).</p>
 
193
  </div>
194
 
195
  <!-- ============ Q5 ============ -->
196
+ <h2>Q5 &nbsp;Halstead Programming Effort <span class="pts">[2 pts] · single choice</span></h2>
197
  <p>Calculate the Halstead <b>programming effort</b> for the following code (parentheses are not counted as operators):</p>
198
  <pre id="q5code"></pre>
199
  <div id="q5opts"></div>