Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

I am working on an question that i dont seem to understand as well so i wanted t

ID: 3817412 • Letter: I

Question

I am working on an question that i dont seem to understand as well so i wanted to see how it would be done.

Assignment: Creating Equivalence Classes, Boundary Values and Test Cases The assignment is to create equivalence classes, boundary values for the equivalence classes, and test cases for the scenario described below. Scenario: A program determines the placement of a student based on the marks in three subjects. Its input is a triple of positive integers, e.g., mark 1, mark 2 and mark 3 and values are from 0 to 100. Placement is determined according to the following rules Average of Marks Placement 75-100 First Division with Distinction First Division 60-74 50-59 Second division Third Division 40-49 0-39 Fail Average is calculated as the sum of the 3 marks divided by 3. The program output is one of the following words: First Division with Distinction, First Division, Second Division, Third Division, Fail Directions: Identify the equivalence classes and boundary values for the equivalence classes, then create test cases for the combinations of input, calculated number and output. (Hint: there are over 30 test cases for this scenario.)

Explanation / Answer

Equivalence Class Testing:

It is when you have a number of test items (e.g. values) that you want to test but because of cost (time/money) you do not have time to test them all. Therefore you group the test item into class where all items in each class are suppose to behave exactly the same. The theory is that you only need to test one of each item to make sure the system works.

classes:-

First Division with distiction --> Avg : 75 -100

First Division --> Avg: 60 - 74

Second Division --> Avg : 50 -59

Third Division --> Avg: 40 - 49

Fail --> Avg : 0 - 39

Boundary Value Testing

Boundary value Testing is when you decide to test the values on the edge of each Class you have identified.

First Division with distiction --> Avg : 75 -100 ( Boundary values 75,100)

First Division --> Avg: 60 - 74 ( Boundary Values 60, 74)

Second Division --> Avg : 50 -59 (Boundary values 50, 59)

Third Division --> Avg: 40 - 49 (Boundary values 40, 49)

Fail --> Avg : 0 - 39 ( Boundary values 0 , 39)

// you can find output using this program and check the test cases;

//This code in c++

#include<iostream>
using namespace std;
class grade
{
private:
   int subject1,subject2,subject3;
   double average;
public:
   grade()
   {
       subject1=0;
       subject2=0;
       subject3=0;
       average=0.0;
   }
   double average_cal(int s1,int s2, int s3)
   {
       subject1=s1;
       subject2=s2;
       subject3 = s3;
       average= subject1+subject2+subject3;
       average=average/3;
       return average;

   }
};
void main()
{
   int sub1,sub2,sub3;
   cout<<"enter three subjects marks ";
   cin>>sub1>>sub2>>sub3;
   grade studentgrade;
double avg=studentgrade.average_cal(sub1,sub2,sub3);
if(avg>=75)
   cout<<"First Division with distiction"<<endl;
else if(avg >=60 && avg <75)
cout<<"First Division "<<endl;
else if(avg>=50 && avg<60)
   cout<<"Second Division"<<endl;
else if(avg >=40 && avg<50)
   cout<<"Third Division"<<endl;
else
   cout<<"Fail"<<endl;
}

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote