## Microsoft Interview Question

Software Engineer in TestsFollowing can be the tests

1. Check to when the line option is selected, the button dims out.

2. Then check and see if the cursor changes to a pointer.

3. Check to see if you can draw a line

4. Move the pointer up and down, sideways to check if all vertical, horizontal , diagonal lines can be drawn.

5. Check to see if you change the color , then the color of the lines also changes

6. Check to see when you change the width of the line, it changes.

7. Test to see if you can draw that line over a already drawn figure.

8. Test to see if the lines stops drawing if you take the pointer outside the paint window (boundary condition).

The above is not a good approach to test a paint, this is how it should be done.

First, consider all the inputs for the line function, in simplest terms, a line function input can be start and the end coordinates.

Output should be a line between those points.

Now we should first do the functional testing of this function by considering the boundary conditions and the values as -ve and 0.

For Boundary Condition.

If the end point is more than the prescribed limit of the paint window, the function should return the line whose end point coordinates will lie at the periphery of the screen.

If the start point and the end point are both negative, then no output should be 0.

If the start point and the end point are both 0, then a nothing should be output,

if the start and the end point are both same, then a dot should be output.

Now also considering that the line function has one more parameter which define the width of the line.

if the parameter is 0, then the width of the line should be default.

if the parameter is -ve, then the width of the line still should be the default width.

if the parameter value is more then the defined limit, then the largest possible defined width line should be the output.

And for checking the width , there can be function which can check how many pixels line were occupied by the line.

You can also go ahead and add one more parameter like color, but I guess after this interviewer will stop :)

some ideas pls ...

- Anonymous November 28, 2009