Software Testing Practical 7 Answers (22518)
Design Test Cases for Control and Decision-Making Statement
* Practical Related Questions.
1) State the different way to test the decision and control statements.
Ans => Decision making statement are used to skip or to execute a group of statements based on the result of some condition.
1) Simple if statement
2) if else statement
3)nested if
4) Switch statement
Control statement is a statement that determine whether other statement will be executed another Statement a loop decides how many times to execute another statement.
2) For any decision statements what is be the Possible Outcomes while writing the test cases.
Ans =>Whenever there are two or more possible exits from the statement like an IF statement, a DO-WHILE or a CASE statement it is known as decision because in all these statements there are two outcomes, either TRUE or FALSE. ... Alternatively, you can say that control statement IF has been evaluated both to TRUE and FALSE.
3) Can we test relational operator? Validate the answer with justifications.
Ans=>A relational operator is a programming language construct or operator that tests or defines some kind of relation between two entities. These include numerical equality (e.g., 5 = 5) and inequalities (e.g., 4 ≥ 3). that include a distinct Boolean data type in their type of system, like Pascal, Ada, or Java, these operators usually evaluate to true or false, depending on if the conditional relationship between the two operands holds or not. In languages such as C, relational operators return the integers 0 or 1, where 0 stands for false and any non-zero value stands for true.
* Exercise
Ans=> Suppose you want to test whether a number is odd or even. Where T is the test cases. and first line of each test case contains an integer which will be tested. And finally print whether each input is even or odd.
0 Comments