Program: 57531
Project: 57531
Buggy source:
/** 
 * Performs a  <a href="http://www.itl.nist.gov/div898/handbook/eda/section3/eda353.htm"> two-sided t-test</a> evaluating the null hypothesis that  <code>sampleStats1</code> and <code>sampleStats2</code> describe datasets drawn from populations with the same mean, with significance level <code>alpha</code>.   This test does not assume that the subpopulation variances are equal.  To perform the test under the equal variances assumption, use  {@link #homoscedasticTTest(StatisticalSummary,StatisticalSummary)}. <p> Returns <code>true</code> iff the null hypothesis that the means are equal can be rejected with confidence <code>1 - alpha</code>.  To  perform a 1-sided test, use <code>alpha / 2</code> <p> See   {@link #t(double[],double[])} for the formula used to compute thet-statistic.  Degrees of freedom are approximated using the <a href="http://www.itl.nist.gov/div898/handbook/prc/section3/prc31.htm"> Welch-Satterthwaite approximation.</a> <p> <strong>Examples:</strong><br><ol> <li>To test the (2-sided) hypothesis <code>mean 1 = mean 2 </code> at the 95%, use  <br><code>tTest(sampleStats1, sampleStats2, 0.05) </code> </li> <li>To test the (one-sided) hypothesis <code> mean 1 < mean 2 </code> at the 99% level,  first verify that the measured mean of   <code>sample 1</code> is less than  the mean of <code>sample 2</code> and then use  <br><code>tTest(sampleStats1, sampleStats2, 0.005) </code> </li></ol> <p> <strong>Usage Note:</strong><br> The validity of the test depends on the assumptions of the parametric t-test procedure, as discussed  <a href="http://www.basic.nwu.edu/statguidefiles/ttest_unpaired_ass_viol.html"> here</a> <p> <strong>Preconditions</strong>: <ul> <li>The datasets described by the two Univariates must each contain at least 2 observations. </li> <li> <code> 0 < alpha < 0.5 </code> </li></ul>
 * @param sampleStats1 StatisticalSummary describing sample data values
 * @param sampleStats2 StatisticalSummary describing sample data values
 * @param alpha significance level of the test
 * @return true if the null hypothesis can be rejected with confidence 1 - alpha
 * @throws IllegalArgumentException if the preconditions are not met
 * @throws MathException if an error occurs performing the test
 */
public abstract boolean tTest(StatisticalSummary sampleStats1,StatisticalSummary sampleStats2,double alpha) throws IllegalArgumentException, MathException ;

Fixed version (ground truth):
/** 
 * Performs a  <a href="http://www.itl.nist.gov/div898/handbook/eda/section3/eda353.htm"> two-sided t-test</a> evaluating the null hypothesis that  <code>sampleStats1</code> and <code>sampleStats2</code> describe datasets drawn from populations with the same mean, with significance level <code>alpha</code>.   This test does not assume that the subpopulation variances are equal.  To perform the test under the equal variances assumption, use  {@link #homoscedasticTTest(StatisticalSummary,StatisticalSummary)}. <p> Returns <code>true</code> iff the null hypothesis that the means are equal can be rejected with confidence <code>1 - alpha</code>.  To  perform a 1-sided test, use <code>alpha * 2</code> <p> See   {@link #t(double[],double[])} for the formula used to compute thet-statistic.  Degrees of freedom are approximated using the <a href="http://www.itl.nist.gov/div898/handbook/prc/section3/prc31.htm"> Welch-Satterthwaite approximation.</a> <p> <strong>Examples:</strong><br><ol> <li>To test the (2-sided) hypothesis <code>mean 1 = mean 2 </code> at the 95%, use  <br><code>tTest(sampleStats1, sampleStats2, 0.05) </code> </li> <li>To test the (one-sided) hypothesis <code> mean 1 < mean 2 </code> at the 99% level,  first verify that the measured mean of   <code>sample 1</code> is less than  the mean of <code>sample 2</code> and then use  <br><code>tTest(sampleStats1, sampleStats2, 0.02) </code> </li></ol> <p> <strong>Usage Note:</strong><br> The validity of the test depends on the assumptions of the parametric t-test procedure, as discussed  <a href="http://www.basic.nwu.edu/statguidefiles/ttest_unpaired_ass_viol.html"> here</a> <p> <strong>Preconditions</strong>: <ul> <li>The datasets described by the two Univariates must each contain at least 2 observations. </li> <li> <code> 0 < alpha < 0.5 </code> </li></ul>
 * @param sampleStats1 StatisticalSummary describing sample data values
 * @param sampleStats2 StatisticalSummary describing sample data values
 * @param alpha significance level of the test
 * @return true if the null hypothesis can be rejected with confidence 1 - alpha
 * @throws IllegalArgumentException if the preconditions are not met
 * @throws MathException if an error occurs performing the test
 */
public abstract boolean tTest(StatisticalSummary sampleStats1,StatisticalSummary sampleStats2,double alpha) throws IllegalArgumentException, MathException ;