İstanbul evden eve nakliyat Beylikd¨¹z¨¹ evden eve nakliyat Tuzla evden eve nakliyat
Tutorial-9 To Find out the Roots of a Quadratic Equation and Generate its Boundary Value Test Cases
Delicious Bookmark this on Delicious
software testing genius

Tutorial-9 To Find out the Roots of a Quadratic Equation and Generate its Boundary Value Test Cases

Welcome to “Software Testing Genius”. Subscribe to my RSS feed for latest content on Software Testing.

Tutorial-9: To Find out the Roots of a Quadratic Equation and Generate its Boundary Value Test Cases

Inputs for the Tutorial:
A quadratic equation a(x2)+bx+c=0 with input as three positive integers a, b, c having values ranging from an interval [0,100].

Objective of this Tutorial: There are two objectives of the tutorial like:

Objective –1:
To write a Program in C++ for the determining the nature of roots of the above quadratic equation. The program output may have one of the following words:

"Not a Quadratic Equation", "Real Roots", "Imaginary Roots" or "Roots are Equal"

color=#800000 size=2>Objective –2: Boundary Value Testing by designing Test Cases which would use input variables at their Minimum Values, Just above Minimum Values, at Nominal Value, Just below Maximum and Minimum Values.

Solution Part – 1: Program in C++

#include
#include
void main( )
{
clrscr( );
int a,b,c,d;
cout<<"The quadratic equation is of the type a(x2)+bx+c=0"<cout<<"Enter the value of a:"<cin>>a;
cout<<"Enter the value of b:"<cin>>b;
cout<<"Enter the value of c: "<cin>>c;
d = (b*b)-4*a*c;
if((a<0)||(b<0)||(c<0)||(a>100)||(b>100)||(c>100))
cout«"Invalid input"«end1;
elseif(a==0)
cout<<"Not a quadratic equation"<elseif(d==0)
cout<<"Roots are equal"<else if(d<0)
cout<<"Imaginary roots"<else
cout<<"Real roots"<getch();
}

Solution Part – 2: Design Boundary Value Test Cases

In the above program, we consider the values as 0 (Minimum), 1 (Just above Minimum), 50 (Nominal), 99 (Just below Maximum) and 100 (Maximum)

Test Case ID

a

b

c

Expected Output

1

50

50

0

Real Roots

2

50

50

1

Real Roots

3

50

50

50

Imaginary Roots

4

50

50

99

Imaginary Roots

5

50

50

100

Imaginary Roots

6

50

0

50

Imaginary Roots

7

50

1

50

Imaginary Roots

8

50

99

50

Imaginary Roots

9

50

100

50

Equal Roots

10

0

50

50

Not a Quadratic Equation

11

1

50

50

Real Roots

12

99

50

50

Imaginary Roots

13

100

50

50

Imaginary Roots

Some of the screenshots with different outputs are as under:

1) Screenshot with Output as " Imaginary Roots" is as under



2) Screenshot with Output as "Real Roots" is as under



3) Screenshot with Output as "Roots are Equal" is as under



4) Screenshot with Output as "Not a Quadratic Equation" is as under



Many More Articles & Tutorials on Black Box Testing 

Largest Database of Sample Papers - 1000+ Unique Questions for ISTQB Foundation Exam

ISTQB Foundation Exam - Full Crash Course for Download

ISTQB Advanced CTAL Test Analysts Exam - Full Crash Course for Download


ISTQB Advanced CTAL Test Manager Exam - Full Crash Course for Download


What Successful Testers say about the Quality of this website

If you want to keep track of further articles on Software Testing,
I suggest you to subscribe my
RSS feed
.

You can also Subscribe by E-mail
and get All New articles delivered directly to your Inbox.

Get your Absolutely Free Copy of Several MS PowerPoint Presentations & E-Books related to ISTQB, HP Load Runner, IBM RFT, HP QTP & QC Certification Exams, prepared by Popular Writers & Trainers, by writing to: Software.testing.genius@gmail.com

Full Study Material for Popular Certification Exams:

Study Material - HP QTP & QC Certification Exam

Study Material - IBM RFT Certification Exam

Study Material - HP LoadRunner Certification Exams for All Modules

Study Material - ISTQB Certification Exam

Most Popular Topics in Demand:

Practical Roadmap to QTP Certification

Practical Roadmap to CSTE Certification

Consolidated Study Material - Testing & QA

Rehearsal of QTP in 1 Hr. -  Interview Questions

 

Comments :

comments ↓


Leave Your Comments: (*) Marked Fields are Mandatory

You can apply basic formatting to the text

Name *
 
Email Address *
 
Website
 
Speak your mind
characters
sex hikayeleri