Forum : Please explain these questions in detalis.
Brief description  about Online courses   join in Online courses
View Shruti  Mahajan 's Profile

Please explain these questions in detalis.


1. 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 is taxed at 22% Any further amount is taxed at 40% Which of these groups of numbers would fall into the same equivalence class?
a) £4800; £14000; £28000
b) £5200; £5500; £28000
c) £28001; £32000; £35000
d) £5800; £28000; £32000



2. Pick up and read the newspaper
Look at what is on television
If there is a program that you are interested in watching then switch the the television on and watch the program
Otherwise
Continue reading the newspaper
If there is a crossword in the newspaper then try and complete the crossword

a) SC = 1 and DC = 1
b) SC = 1 and DC = 2
c) SC = 1 and DC = 3
d) SC = 2 and DC = 2
e) SC = 2 and DC = 3


3. How many test cases are necessary to cover all the possible sequences of statements (paths) for the following program fragment? …………
if (Condition 1)
then statement 1
else statement 2
fi
if (Condition 2)
then statement 3
fi
…………
a. 1
b. 2
c. 3
d. None of the above


4. If the pseudocode below were a programming language ,how many tests are required to achieve 100% statement coverage?

1. If x=3 then
2. Display_messageX;
3. If y=2 then
4. Display_messageY;
5. Else
6. Display_messageZ;
7. Else
8. Display_messageZ;

a. 1
b. 2
c. 3
d. 4


5. Using the same code example as question 17,how many tests are required to achieve 100% branch/decision coverage?

a. 1
b. 2
c. 3
d. 4
Asked by Shruti Mahajan | Aug 28, 2013 |  Reply now
Replies (1)
View testing instructor 's Profile
1. Suppose that employee salary is up to 4,000 is tax free.Then next 1500 (means 4000+ 1500 )has 10%.That means 4001 to 5500 Has 10% Tax. Next 28,000 Has 22% tax. That means 5501 to 33,500(28,000+5,500) has 22% tax. More then that, means 33,501 has 40% tax.

That means answer should lies between 5,501 to 33,500 class.

2)Two type of test case :

1)Statement coverage (SC) : In this case test case is executed so that every statement are covered atleast once.

2)Decisions Coverage (DC):In this case test case is executed so that all decisions(T/F) are executed atleast once.

In this case we can try through flow chart :

A- B- C- D

Read newspaper-look at TV page-If program interested(Yes)-on TV Watch program

E- F- G

(No)-Continue reading-If puzzle found(yes)-try and complete

H
(No)-Continue reading.

paths to cover all statements Coverage(SC)

i) ABCD

ii) ABEFGH

For decision coverage(DC)

i)ABCD

ii) ABEFGH

iii) ABEFH (Since in second If statement we take the path that says No).This is not necessary to cover in statement coverage.Because already that statement is covered by going through the previous path.


3) check the program loop for minimum test case require to satisfy all the condition on question number 3 and 4.
Aug 29, 2013