Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

For the attached triangle function, create test suites using the following methods ( Make sure to look in the book to see which have already

For the attached triangle function, create test suites using the following methods (Make sure to look in the book to see which have already been identified for you):

  • Normal Boundary Value Analysis Testing
  • Weak Normal Equivalence Class Testing
  • Decision Table-Based Testing

Report the code coverage (from both ElcEmma via JUnit and from PITTest) and mutation score for each test suite. Please be sure to include the number of mutants killed and total mutants.

Based on the results, answer the following questions:

  • How does each method do at killing mutants? Why?
  • Would other variants of these same methods (e.g., Strong Robust Equivalence Class Testing) perform better at killing mutants? Justify your answer via identification of test cases that do or do not improve mutation score.

Identify at least one mutation not identified by the previous methods and:

  • Create a test to kill the mutation, and
  • Discuss if the test adds value to the test suite.

CODE BELOW

-----

public class Triangle { public static final int INVALID = -1; public static final int SCALENE = 0; public static final int ISOSELES = 1; public static final int EQUILATERAL = 2; public static int triangle2(int a, int b, int c) { boolean isATriangle; // Is A Triangle? if((a  

----

import static org.junit.Assert.*; import org.junit.Test; public class TriangleTest { @Test public void test() { assertEquals(Triangle.INVALID, Triangle.triangle2(0, 0, 0)); assertEquals(Triangle.INVALID, Triangle.triangle2(1, 1, 3)); assertEquals(Triangle.EQUILATERAL, Triangle.triangle2(2, 2, 2)); assertEquals(Triangle.ISOSELES, Triangle.triangle2(2, 2, 3)); assertEquals(Triangle.SCALENE, Triangle.triangle2(2, 3, 4)); } }

----------

TEST CASES BELOW

image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions