Lab2 Error Fault Failures
Lab2 Error Fault Failures
Statement Purpose:
The purpose of this lab is to create an understanding of the fundamental concepts of Software
Testing like Errors, Fault/Bug/Defect, Failure.
Activity Outcomes:
- Understanding of Error, Fault and Failure in Java Program.
- Student will be able to find Bugs in any of the software products.
1) Stage J (Journey)
Introduction:
2) Stage a1 (apply)
Lab Activity 1:
The example demonstrates the difference in Error, Fault and Failure.
pre: param is an integer.
post: returns the product of the param multiplied by 2.
Lab Activity 2:
The example demonstrates the difference in Error, Fault and Failure.
2) Stage v (verify)
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();
}
}
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.
Activity 3:
Find the maximum number of bugs in the following website and fill the provided Bug report sheet
template.
https://homeshopping.pk/