Museum Application Testing
A museum’s digital collection application uses the following pseudocode to determine if an artifact should be displayed in the ‘Featured’ section. An artifact is featured if it is older than 500 years OR if it has been viewed more than 1000 times. However, artifacts that are currently on loan to other museums cannot be featured, regardless of age or views.
IF ((age > 500) OR (views > 1000))
{
IF (onLoan == false)
{
DISPLAY(“Featured”)
}
ELSE
{
DISPLAY(“Not Featured”)
}
}
ELSE
{
DISPLAY(“Not Featured”)
}
Which of the following sets of test cases covers all three distinct branches of the supplied pseudocode?
Test 1: age = 600, views = 500, onLoan = false. Test 2: age = 400, views = 1500, onLoan = true. Test 3: age = 300, views = 500, onLoan = false.
Test 1: age = 400, views = 500, onLoan = false. Test 2: age = 400, views = 500, onLoan = true. Test 3: age = 300, views = 500, onLoan = false.
Test 1: age = 600, views = 1500, onLoan = false. Test 2: age = 400, views = 500, onLoan = true. Test 3: age = 300, views = 500, onLoan = false.
Test 1: age = 600, views = 500, onLoan = false. Test 2: age = 600, views = 500, onLoan = true. Test 3: age = 400, views = 1500, onLoan = false.
Question Leaderboard
Not enough data yet to show leaderboard.
