Boundary conditions for testing
<p>Ok so in a programming test I was given the following question.</p>

<blockquote>
  <p>Question 1 (1 mark)</p>
  
  <p>Spot the potential bug in this section of code:</p>
</blockquote>

<pre><code>void Class::Update( float dt )
{
    totalTime += dt;
    if( totalTime == 3.0f )
    {
        // Do state change
        m_State++;
    }
}
</code></pre>

<p>The multiple choice answers for this question were.</p>

<blockquote>
  <p>a) It has a constant floating point number where it should have a named constant variable</p>
  
  <p>b) It may not change state with only an equality test</p>
  
  <p>c) You don't know what state you are changing to</p>
  
  <p>d) The class is named poorly  </p>
</blockquote>

<p>I wrongly answered this with answer C.</p>

<p>I eventually received feedback on the answers and the feedback for this question was</p>

<blockquote>
  <p>Correct answer is a.  This is about understanding correct boundary conditions for tests.  The other answers are arguably valid points, but do not indicate a potential bug in the code.</p>
</blockquote>

<p>My question here is, what does this have to do with boundary conditions? My understanding of boundary conditions is checking that a value is within a certain range, which isn't the case here. Upon looking over the question, in my opinion, B should be the correct answer when considering the accuracy issues of using floating point values. </p>
