wb & bb exercises.doc

4
Postal rates for 'light letters' are 25p up to l0g, 35p up to 50g plus an extra l0p for each additional 25g up to l00g. Which test inputs (in grams) would be selected using equivalence partitioning? a. 8,42,82,102 b. 4,15, 65, 92,159 c. 10,50,75,100 d. 5, 20, 40, 60, 80 In a system designed to work out the tax to be paid: An employee has £4000 of salary tax free. The next £1500 is taxed at 10%. The next £28000 after that is taxed at 22%. Any further amount is taxed at 40%. To the nearest whole pound, which of these is a valid Boundary Value Analysis test case? A £28000. B £33501. C £32001. D £1500. If you are flying with an economy ticket, there is a possibility that you may get upgraded to business class, especially if you hold a gold card in the airline's frequent flier program. If you don't hold a gold card, there is a possibility that you will get 'bumped' off the flight if it is full and you check in late. Three tests have been run: Test 1: Gold card holder who gets upgraded to business class Test 2: Non-gold card holder who stays in economy Test 3: A person who is bumped from the flight What is the statement coverage of these three tests? a. 60% b. 70% c. 80% d. 90% Given the state diagram, which test case is the minimum series of valid transitions to cover every state?

Upload: hammerady

Post on 03-Jan-2016

46 views

Category:

Documents


0 download

DESCRIPTION

WB & BB exercises.doc

TRANSCRIPT

Page 1: WB & BB exercises.doc

Postal rates for 'light letters' are 25p up to l0g, 35p up to 50g plus an extra l0p for each additional 25g up to l00g.Which test inputs (in grams) would be selected using equivalence partitioning?a. 8,42,82,102b. 4,15, 65, 92,159c. 10,50,75,100d. 5, 20, 40, 60, 80

In a system designed to work out the tax to be paid: An employee has £4000 of salary tax free.The next £1500 is taxed at 10%.The next £28000 after that is taxed at 22%.Any further amount is taxed at 40%.To the nearest whole pound, which of these is a valid Boundary Value Analysis test case?A £28000. B £33501. C £32001. D £1500.

If you are flying with an economy ticket, there is a possibility that you may get upgraded to business class, especially if you hold a gold card in the airline's frequent flier program. If you don't hold a gold card, there is a possibility that you will get 'bumped' off the flight if it is full and you check in late. Three tests have been run:Test 1: Gold card holder who gets upgraded to business class

Test 2: Non-gold card holder who stays in economy

Test 3: A person who is bumped from the flight What is the statement coverage of these three tests?a. 60%b. 70%c. 80%d. 90%

Given the state diagram, which test case is the minimum series of valid transitions to cover every state?

a. SS-S1-S2-S4-S1-S3-ESb. SS-S1-S2-S3-S4-ESc. SS-S1-S2-S4-S1-S3-S4-S1-S3-ESd. SS-S1-S4-S2-S1-S3-ES

Page 2: WB & BB exercises.doc

Given the following state transition

Which of the following series of state transitions below will provide 0-switch coverage?

A A, B, E, B, C, F, D. B A, B, E, B, C, F, F. C A, B, E, B, C, D. D A, B, C, F, F, D.

Given the following State Table:

Which of the following represents an INVALID state transition?

A E from State S2. B E from State S3. C B from State S1. D F from State S3.

Page 3: WB & BB exercises.doc

Consider the decision table.

Given this decision table, what is the expected result for the following test cases?TCI: A 26-year-old on business but with violations or accidents on his driving recordTC2: A 62-year-old tourist with a clean driving recorda. TCI: Don't supply car; TC2: Supply car with premium charge.b. TCI: Supply car with premium charge; TC2: Supply car with no premium charge.c. TCI: Don't supply car; TC2: Supply car with no premium charge.d. TCI: Supply car with premium charge; TC2: Don't supply car.

Given the following code, which option is true about the minimum number of test cases for full statement and decision coverage:

Read M Read N If M > N then print “Message 21”ENDIFIf N >= M then Print “Message 31” If N > 10 then Print “Message 41” ENDIFENDIFPrint “END”

a) 1 test for statement coverage, 2 tests for decision coverage

b) 1 test for statement coverage, 3 tests for decision coverage

c) 2 tests for statement coverage, 2 tests for decision coverage

d) 2 tests for statement coverage, 3 tests for decision coverage