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;.
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 falseStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started