Activity 1:
Evaluate software by observing it’s execution. Introduce some errors, faults and failures to explain your
answer.
Consider the concept of a CourseResult. The CourseResult should have data members like the student name,
course name and grade obtained in that course. This concept can be represented in a class as follows:
Public class CourseResult
{
Public String studentname;
Public String coursename;
Public String grade;
public void display()
{
System.out.println("Student Name is: ― + studentname + "Course Name is: ― + coursename + "Grade is: ― +
grade); }
}
Public class CourseResultRun
{
public static void main(String[]args)
{
CourseResult c1=new CourseResult (); c1.studentName= ―Ali‖; c1.courseName= ―OOP‖; c1.grade= ―A‖;
c1.display();
CourseResult c2=new CourseResult ();
c2.studentName= ―Saba‖;
c2.courseName= ―ICP‖;
c2.grade= ―A+‖;
c2.display();
}
}
Report:
import jdk.jfr.Timestamp;
class CourseResult
{
public String studentname;
public String coursename;
public String grade;
public void display()
{
System.out.println("Student Name is: " + studentname + "\nCourse Name is: " + cours
ename + "\nGrade is: " + grade);
}
}
class CourseResultRun
{
public static void main(String[]args)
{
CourseResult c1 = new CourseResult();
c1.studentname= "ALi";
c1.coursename= OOP;
c1.grade= "A+";
c1.display();
CourseResult c2 =new CourseResult();
c2.studentname= "Saba";
c2.coursename= "ICP";
c2.grade= "A+";
c2.display();
}
}
Test Case 1:
c1.studentname= "ALi";
c1.coursename= 'OOP';
c1.grade= "A+";
If we try to assign a character type to string it will be an error
Test Case 2:
c1.studentname= "ALi";
c1.coursename= "BIO";
c1.grade= 22;
If user tries to assign integer then it is also an error.
Test Case 3:
c1.studentname= "ALi";
c1.coursename= "BIO";
c1.grade= "A+";
This test case passes the test.
Test Case 4:
c2.studentname= "Saba";
c2.coursename= "ICP";
c2.grade= "A+";
This test case passes the test.
Activity 2:
Design a class Point with two data members x-cord and y-cord. This class should have an arguments constructor,
setters, getters and a display function. Now create another class ―Line‖, which contains two Points ―startPoint‖
and ―endPoint‖. It should have a function that finds the length of the line. Hint: formula is: sqrt((x2-x1) 2 + (y2-
y1) 2 ) Create two line objects in runner and display the length of each line.
Write test cases to check the above functionality by introducing different errors, faults and failure Mention
3 test cases for failures and 3 for Non failures as shown in above example.
public double calLength(){
return Math.sqrt(Math.pow((x2-x1),x2) + Math.pow((y2-y1),2));
}
Point p1 = new Point(2, 6);
Point p2 = new Point(1, 7);
Point p3 = new Point(5, 6);
Point p4 = new Point(4, 8);
Point p5 = new Point(7, 6);
Point p6 = new Point(6, 8);
Expected:
Length of Line 1 is: 1.4142135623730951
Length of Line 2 is: 2.23606797749979
Length of Line 3 is: 2.23606797749979
Actual:
Length of Line 1 is: 1.4142135623730951
Length of Line 2 is: 2.23606797749979
Length of Line 3 is: 2.23606797749979
Test Case 1:
Point p3 = new Point(5, 6);
Point p4 = new Point(1, 8);
Point p5 = new Point(7, 6);
Point p6 = new Point(6, 8);
Point p1 = new Point(4, 6);
Point p2 = new Point(1, 7);
Expected:
Length of Line 1 is: 3.1622776601683795
Length of Line 2 is: 4.47213595499958
Length of Line 3 is: 2.23606797749979
Actual:
Length of Line 1 is: 5.291502622129181
Length of Line 2 is: 8.246211251235321
Length of Line 3 is: 2.23606797749979
Test Case 2:
public double calLength(){
return Math.sqrt(Math.pow((x2-x1),x2) + Math.pow((y2-y1),2));
}
Point p1 = new Point(4, 6);
Point p2 = new Point(5, 7);
Point p3 = new Point(5, 6);
Point p4 = new Point(6, 8);
Point p5 = new Point(7, 6);
Point p6 = new Point(8, 8);
Expected:
Length of Line 1 is: 1.4142135623730951
Length of Line 2 is: 2.23606797749979
Length of Line 3 is: 2.23606797749979
Actual:
Length of Line 1 is: 1.4142135623730951
Length of Line 2 is: 2.23606797749979
Length of Line 3 is: 2.23606797749979
Test Case 3:
Point p1 = new Point(4, 6);
Point p2 = new Point(9, 7);
Point p3 = new Point(2, 6);
Point p4 = new Point(9, 8);
Point p5 = new Point(2, 6);
Point p6 = new Point(6, 8);
Expected:
Length of Line 1 is: 5.0990195135927845
Length of Line 2 is: 7.280109889280518
Length of Line 3 is: 4.47213595499958
Actual:
Length of Line 1 is: 1397.5428437081991
Length of Line 2 is: 6352.449212705285
Length of Line 3 is: 64.03124237432849
Activity 3:
BUG SHEET TEMPLATE
1.
BUG ID TESTER
1 Rai ABdullah
BUG TITLE DATE BUG SUBMITTED
Bad Verification 21-09-2021
BUG DESCRIPTION SUMMARY OF THE ISSUE
It does not verify phone number properly. This may cause problem while getting backup of account.
URL WHERE BUG ENCOUNTERED if applicable PLATFORM ON WHICH BUG ENCOUNTERED
https://homeshopping.pk/account.php?action=account_details https://homeshopping.pk
BROWSER USED if an online bug DATE AND TIME BUG ENCOUNTERED
Chrome 21-09-2021 3:30 pm
SCREENSHOT DEMONSTRATING BUG'S BEHAVIOR
BUG ASSIGNED TO DATE AND TIME ASSIGNED
Hassan Turi 21-09-2021 3:30 pm
PRIORITY compared to other bugs SEVERITY
High High
2.
BUG ID TESTER
2 Rai ABdullah
BUG TITLE DATE BUG SUBMITTED
Bad UI design 21-09-2021
BUG DESCRIPTION SUMMARY OF THE ISSUE
Light green border is used with white background that is not prominent to see. A very dull combination is used for UI experience.
URL WHERE BUG ENCOUNTERED if applicable PLATFORM ON WHICH BUG ENCOUNTERED
https://homeshopping.pk/login.php?action=check_login%20%27%20and https://homeshopping.pk
BROWSER USED if an online bug DATE AND TIME BUG ENCOUNTERED
Chrome 21-09-2021 3:30 pm
SCREENSHOT DEMONSTRATING BUG'S BEHAVIOR
BUG ASSIGNED TO DATE AND TIME ASSIGNED
Hassan Turi 21-09-2021 3:30 pm
PRIORITY compared to other bugs SEVERITY
Low Low