Software Engineering for Smart Data Analytics & Smart Data Analytics for Software Engineering
( Object Oriented Programming ) - ( Black Box Testing ) - ( Small Refactoring ) - ( Refactoring the Three Key Cup App )
Code for this tutorial: https://github.com/dsp-de/tutorial-dark-triangles |
---|
Triangle.contains(Triangle t)
and it is supposed to check if the triangle contains some other triangle t. For example the green triangle on the right contains the red one, i.e. greenTriangle.contains(redTriangle)
should be true. On the other hand the red doesn't contain the green one, i.e. redTriangle.contains(greenTriangle)
should be false.To solve the following task we recommend to use one or both of the following preparations.
You may optionally implement the contains
method yourself in a Test-First manner1). You don't need to do it, but this will strongly increase your chances to solve the task. Finding the correct implementation is not that easy. The main point of this preparation is to get some experience with finding test cases.
Your company decided that it is too difficult3) to develop the contains(..)
method within the company. So they announced that they want to buy an implementation. In response they got 17 implementations, but they doubt that many of them are correct. You got the job to find the implementation that is working. Of course you didn't get the source code, but you are a smart tester. Write some tests to find the implementation your company should actually buy. If you did the optional step, you can use the tests that your produced. Here is your guide to the source code:
cls
contains the implementations Triangle00
till Triangle16
.tst
you find the class geometry.TriangleTest
. This test exercises all the implementations using the same test methods for each.4)Triangle14
and Triangle16
are out.ifOneTriangleIsVeryLargeAndTheOtherVerySmall
is annotated with @Ignore
and therefore ignored.@Ignore
annotation and run the tests again.createTriangle(..)
method to create triangles. Don't use the constructors directly!createTriangle(..)
method to create triangles!