title: How to create a test run/plan for a C++ Program?
body: <p>Hi I have a c++ class called <code>Date</code>. The codes are below. How to create a test run for the class? Am very much new to C++. I have searched a lot but couldn't able find any fruitful/useful websites for that. Please someone can help? Thanks in advance.</p>
  
  <p><code>date.h</code></p>
  
  <pre><code>#ifndef H_date
  #define H_date 
  #include &lt;iostream&gt; 
  using namespace std; 
  class Date{
      friend ostream &amp;operator &lt;&lt; (ostream &amp; os, const Date &amp;);
      friend istream &amp;operator &gt;&gt; (istream &amp; is, Date &amp;);
  
  public:
      Date();
      Date(int day, int month, int year);
      void setday(int day);
      void setmonth(int month);
      void setyear(int year);
      void setDate(int day, int month, int year);
      int getday() const;
      int getmonth() const;
      int getyear() const;
      void print() const;
  protected:
      int day;
      int month;
      int year; 
  };
  #endif
  </code></pre>
  
  <p><code>date.cpp</code></p>
  
  <pre><code>#include &lt;iostream&gt;
  #include "date.h"
  using namespace std;
  Date::Date()
  {
      day = 0;
      month = 0;
      year = 0;
  }
  Date::Date(int newDay, int newMonth, int newYear)
  {
      day = newDay;
      month = newMonth;
      year = newYear;
  }
  void Date::setday(int newDay)
  {
      day =newDay;
  }
  void Date::setmonth(int newMonth)
  {
      month = newMonth;
  }
  void Date::setyear(int newYear)
  {
      year = newYear;
  }
  
  void Date::setDate(int newDay, int newMonth, int newYear)
  {
      day =newDay;
      month = newMonth;
      year = newYear;
  }
  int Date::getday()const
  {
      return day;
  
  }
  int Date::getmonth()const
  {
      return month;
  
  }
  int Date::getyear()const
  {
      return year;
  
  }
  
  void Date::print()const
  {
      cout &lt;&lt; day &lt;&lt; ":" &lt;&lt; month&lt;&lt; ":" &lt;&lt; year &lt;&lt;endl;
  }
  ostream&amp; operator&lt;&lt; (ostream&amp; osObject, const Date&amp; date1)
  {
      osObject &lt;&lt; date1.day
          &lt;&lt; ":" &lt;&lt;date1.month
          &lt;&lt; ":" &lt;&lt; date1.year;
      return osObject;
  
  }
  istream&amp; operator&gt;&gt; (istream&amp; isObject, Date&amp; date1)
  {
      isObject&gt;&gt;date1.day&gt;&gt;date1.month&gt;&gt;date1.year;
      return isObject;
  
  }
  </code></pre>