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](https://dsd5zvtm8ll6.cloudfront.net/si.experts.images/questions/2024/09/66f4516852232_65566f45167c5ea6.jpg)
Before Bill found this error, he tested his function using the following test input:

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
Get step-by-step solutions from verified subject matter experts
