# Thread: How to verify and validate below code?

1. ## How to verify and validate below code?

Recently I came accross with an intesting question in an interview attended.

Knowing the concept of varification and validation how do you perform verification and validation activity on below code.

a=b+c

Thanks,
Uma

2. ## Re: How to verify and validate below code?

This should probably go to the Interview Questions forum.

3. ## Re: How to verify and validate below code?

[ QUOTE ]
Recently I came accross with an intesting question in an interview attended.

Knowing the concept of varification and validation how do you perform verification and validation activity on below code.

a=b+c

[/ QUOTE ]

And what did you answer to this question?

4. ## Re: How to verify and validate below code?

Well not sure with my answer but tried with best of my knowledge
It's something like this...

Varification activity covers mainly code review

So you can check syntax errors as well you can verify code is compliant to requirement like in requirement it has mentioned multiplication and accidently it's coded sum then you should be able to catch those errors in varfication activity

validation activity covers actual execution of code
So with the set of data you can check actual output with expected
like if you provide a=2 and b=3 then on excution you should receive 5

Any new ideas?

5. ## Re: How to verify and validate below code?

LuckyStar333, you got mixed up verification vs validation. For validation you don't need to think that they accidentally coded addition instead of multiplication. You have to ask them to they really need addition (or may be + sign means something else) in this case and what is this case about. You are on the right way with verification, but also think what else can be used as a,b and c. How about negative numbers, pointers, strings, databases, elephants and so on.

6. ## Re: How to verify and validate below code?

I would think that validation calls for me to execute this code and see if b+c actually equals a (in every case I could excercise the code).

And verification would require me to find out if the user really wants b+c to equal a, or if something else was required.

It was taught to me that validation concerns "are we building it right" and verification concerns "are we building the right thing".

7. ## Re: How to verify and validate below code?

data types

ranges and boundaries

overflow

typecasting

reentrancy

and... functionality

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•

vBulletin Optimisation provided by vB Optimise v2.6.0 Beta 4 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.