TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
RAHUL goswami
NA
10
8.7k
Triangle problem
Sep 24 2013 12:44 PM
I really want to understand this triangle problem in sense of testing. my questions are below.
1. Complete the reportTriangleType method in the Triangle class below. Given three integer
arguments as the three angles of a triangle, reportTriangleType returns the type of the
triangle, scalene, isosceles, or equilateral.
public class Triangle {
public static String reportTriangleType(int angleA, int angleB, int angleC) {
…
}
}
2. Design a test suite for the above program using equivalence partitioning and boundary value
analysis.
• Use a table to list all valid and invalid classes.
• Use a table to list all of your test cases to cover the valid and invalid classes. Each test
case should include both input and expected output.
3. Write a class TriangleTest to test reportTriangleType with all the test cases you have
designed. Fix the bugs, if any. You may use JUnit or NUnit.
For example, the test case whose input is (60, 60, 60) and expected result is "equilateral"
can be translated into assertEqual(Triangle.reportTriangleType(60, 60, 60), "equilateral") or
if (!Triangle.reportTriangleType(60, 60, 60).equalsIgnoreCase("equilateral"))
System.out.println("test failed");
4. For each conditional statement in your program, determine whether or not the test cases
you designed for (2) have achieved branch coverage and multi-condition coverage
Thanks for your help!
Reply
Answers (
2
)
what is COM?
Step by step procedure for hosting .Net application