logo

Crowdly

Browser

Додати до Chrome

Software Testing (LTAT.05.006)

Шукаєте відповіді та рішення тестів для 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 {

02

03    public int compute (int integer) {

04       if (integer >= 2) {

05          return integer + 2;

06       }

07       return integer + 1;

08    }

09

10 }

11 class ComputerTest {

12

13    @Test

14    void testSmallInput () {

15       Computer comp = new Computer();

16       assertTrue(comp.compute(1) == 2);

17    }

18

19 }

 

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.

  1.   public static int evenSum(int[] nums) {

  2.     int esum = 0;

  3.     int i = 0;

  4.     while (i < nums.length) {

  5.        if(nums[i] % 2 == 0) {

  6.           esum += nums[i]; 

  7.        }

  8.        i++;

  9.     }

  10.     return esum;

  11.   } 

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).

0%
100%
0%
0%
Переглянути це питання

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?

0%
100%
0%
0%
Переглянути це питання

What type of testing is not a suitable target for automation?

0%
0%
0%
100%
Переглянути це питання

What is the purpose of Acceptance Testing (AT)?

0%
0%
0%
100%
Переглянути це питання

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?

0%
100%
0%
0%
Переглянути це питання

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?

100%
0%
0%
0%
Переглянути це питання

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?

Переглянути це питання

Хочете миттєвий доступ до всіх перевірених відповідей на moodle.ut.ee?

Отримайте необмежений доступ до відповідей на екзаменаційні питання - встановіть розширення Crowdly зараз!

Browser

Додати до Chrome