In this post, we will study the test cases for a triangle. This question is usually asked in manual testing interviews, in which the interviewer wants to check if you can think of the different test scenarios of a common object like a triangle.

In order to answer these types of questions, basically, we will validate the different requirements which are nothing but the different properties of a triangle.

- Verify that the figure is closed (polygon).
- Verify that the figure is two-dimensional and formed with straight lines only.
- Verify that the figure has exactly three sides.
- Verify that the figure has exactly three vertices.
- Verify that the figure has exactly three angles.
- Verify that the sum of the angles of the figure is 180 degrees.
- Verify that no two sides are parallel to each other.
- Verify that the sum of the length of two sides of the triangle should be greater than the length of the third side.
- Verify that no two angles of a triangle have 90 degrees and above value.
- Verify the type of triangle is as per the specification, based on its sides – scalene, isosceles or equilateral.
- Verify the type of triangle is as per the specification, based on its angles – acute angle, obtuse angle, or right-angled triangle.
- Verify that the area of a triangle is equal to half of the product of its base and height.

## Test Case Examples

Advertisement

Nice Article…. Helped me a lot. Thanks for all important questions.