Question: [Regression testing] The following code fragment contains a function for checking whether a year is a leap year. Suppose a programmer, called Bill, wrote this

[Regression testing]

The following code fragment contains a function for checking whether a year is a leap year. Suppose a programmer, called Bill, wrote this function but later found an error in his code. He subsequently debugged the program by replacing the code in line 16 from return true; to return false;.

[Regression testing] The following code fragment contains a function for checking whether

Before Bill found this error, he tested his function using the following test input:

a year is a leap year. Suppose a programmer, called Bill, wrote

After he made changes to the program, Bill plans to perform regression testing by re-testing the program using the previous test inputs. Due to resource constraints, he is allowed to pick only one previous test input to test the modified program. Which test input in the above test set should Bill choose to perform regression testing and why should such test input be used?

1: public boolean isLeapYear (int theYear) f if (theYear 40) theYear - theYear + 1900 l else f 9 10: if (theYear % 4 0) if (theYear % 100 ! 0) { 12: 13: 14: 15: 16: 17: 18: 19: 20: 21:1) return true; return true; elsef ; Change to "return false; " } else f return false

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!