Шукаєте відповіді та рішення тестів для Software Testing (LTAT.05.006)? Перегляньте нашу велику колекцію перевірених відповідей для Software Testing (LTAT.05.006) в moodle.ut.ee.
Отримайте миттєвий доступ до точних відповідей та детальних пояснень для питань вашого курсу. Наша платформа, створена спільнотою, допомагає студентам досягати успіху!
Have a careful look at the following Java program snippet and its associated test case:
01 public class Computer {0203 public int compute (int integer) {04 if (integer >= 2) {05 return integer + 2;06 }07 return integer + 1;08 }0910 }11 class ComputerTest {1213 @Test14 void testSmallInput () {15 Computer comp = new Computer();16 assertTrue(comp.compute(1) == 2);17 }1819 }
To Do:
a) [1 mark] Apply the following mutation in line 04: ‘2’ is changed to ‘1’. Will the mutant be killed by the given test case? Justify your answer.
b) [1 mark] Now apply the following mutation in line 04: ‘2’ is changed to ‘3’. Will the mutant be killed by the given test case? Justify your answer.
c) [2 marks] Provide a test suite (i.e., test code) that would kill both of the mutants created in a) and b). If the test already provided in lines 11-19 needs to be changed, please state exactly how that change must look like (or provide the new test code). If test cases are missing, please add them. In any case, make it crystal clear how exactly the complete test code should look like and explain how the proposed test suite kills both mutants.
For the method evenSum shown below, perform tasks a), b), and c). You can assume that nums has been well-defined (i.e., is not 'null' and, if not empty, has integers) when the method evenSum is called.
To Do:
a) [1 mark] Write down the cyclomatic complexity. Show your calculation (i.e., the formula and the values used in the formula).
b) [1 mark] Write down a set of linearly independent paths. Use the code line numbers in the nodes of the CFG to express the paths.
c) [2 marks] Write down a minimal set of test cases needed to achieve 100% coverage of the set of linearly independent paths shown in part b). For each test case, state input, output, and the path that it covers.
What is a reasonable definition of ‘inspection efficiency’?
Hint: When selecting your answer keep in mind that the main purpose of inspections is to find bugs (faults).
If you do multi-variate A/B testing with 3 items and each item has 2 variants, how many tests do you have to make?
What type of testing is not a suitable target for automation?
What is the purpose of Acceptance Testing (AT)?
Assume the following test scenarios, expressed in terms of state-transitions, have been executed:
S1 -> E1/A1 -> S2 -> E2/A2 -> S3
S1 -> E1/A1 -> S2 -> E3/A3 -> S1
Which of the tables below are covered by the shown test scenarios and contain all states and transitions defined in the test scenarios?
Look at the following Java method:
public void greeting(int time) {
String result;
result = (time < 18) ? "Good day." : "Good evening.";
System.out.println(result);
}
What set of test cases is correct and would achieve 100% decision coverage in the corresponding control-flow graph?
Which statement about the strength of WBT coverage criteria is correct?
Look at the following Java method:
public void greeting(int time) {
String result;
result = (time > 11) ? "Good day." : "Good morning.";
System.out.println(result);
}
What set of test cases is correct and would achieve 100% node coverage in the corresponding control-flow graph?