logo

Crowdly

Browser

Add to Chrome

Software Testing (LTAT.05.006)

Looking for Software Testing (LTAT.05.006) test answers and solutions? Browse our comprehensive collection of verified answers for Software Testing (LTAT.05.006) at moodle.ut.ee.

Get instant access to accurate answers and detailed explanations for your course questions. Our community-driven platform helps students succeed!

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.

View this question

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.

View this question

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%
View this question

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%
View this question

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

0%
0%
0%
100%
View this question

What is the purpose of Acceptance Testing (AT)?

0%
0%
0%
100%
View this question

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%
View this question

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%
View this question

Which statement about the strength of WBT coverage criteria is correct?

View this question

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?

View this question

Want instant access to all verified answers on moodle.ut.ee?

Get Unlimited Answers To Exam Questions - Install Crowdly Extension Now!

Browser

Add to Chrome