# How will you write testcase for a quadratic equation ?

kurtz182 Profile Answers by kurtz182 Questions by kurtz182

• Member Since Nov-2009 | Dec 13th, 2009

The quadratic equation is a polynomial of the second degree.
Its general form is

ax^2 + bx + c = 0

where x represents a variable and a, b, and c are constants.

I would study the functional requirements and technical specifications and create test cases based on my knowledge. The requirements might include the following features:

1) Text which describes the quadratic equation and how to use the application.
2) A graphical representation of the quadratic function.
3) Text which decribes the first and second root of the equation.
4) Text which describes the equation's descriminant.

I will assume the requirements indicate that the application simply solves for x when all of the constants are input into the equation.  I will also assume there is no

graphical representation supplied by the application. In this case, I would do the following:

1) Enter valid data in all fields and verify result.

2) Enter valid data in all but one field and invalid numeric data in remaining field and ensure validation.

3) Enter valid data in all but one field and no data in remaining field and ensure validation.

4) Enter a = 0 to verify it becomes linear.

5) Data set should include the following types:
a) Integers
- Positive
- Zero
- Negative
b) Decimal (applying greatest number of significant digits)
- Postive
- Negative

6) For each data type, I would
a) Use boundary value analysis to select input data for all data types.
b) Use equivalence class partitioning to minimize input data.

7) Enter alpha characters in all fields and verify validation.

8) Enter special characters in all fields and verify validation.

9) On each text box, I would try to enter numbers that extend beyond the range that the text box can accept.

#### Atulkale04 Profile Answers by Atulkale04

• Nov 25th, 2009

1. Valid test cases with all integer vaules
2. Valid test cases with all imaginary values
3. Valid Test cases with negatives values
4. Valid test cases with infinity values.

Same for invalid test cases.

5. Imp checking the roots vaules in exact quadratic euations and checking output=0
6. If out is 0.00111 something then applying value in system and checking its impact

#### kurtz182 Profile Answers by kurtz182 Questions by kurtz182

• Dec 13th, 2009

The quadratic equation is a polynomial of the second degree.
Its general form is

ax^2 + bx + c = 0

where x represents a variable and a, b, and c are constants.

I would study the functional requirements and technical specifications and create test cases based on my knowledge. The requirements might include the following features:

1) Text which describes the quadratic equation and how to use the application.
2) A graphical representation of the quadratic function.
3) Text which decribes the first and second root of the equation.
4) Text which describes the equation's descriminant.

I will assume the requirements indicate that the application simply solves for x when all of the constants are input into the equation.  I will also assume there is no

graphical representation supplied by the application. In this case, I would do the following:

1) Enter valid data in all fields and verify result.

2) Enter valid data in all but one field and invalid numeric data in remaining field and ensure validation.

3) Enter valid data in all but one field and no data in remaining field and ensure validation.

4) Enter a = 0 to verify it becomes linear.

5) Data set should include the following types:
a) Integers
- Positive
- Zero
- Negative
b) Decimal (applying greatest number of significant digits)
- Postive
- Negative

6) For each data type, I would
a) Use boundary value analysis to select input data for all data types.
b) Use equivalence class partitioning to minimize input data.

7) Enter alpha characters in all fields and verify validation.

8) Enter special characters in all fields and verify validation.

9) On each text box, I would try to enter numbers that extend beyond the range that the text box can accept.  