Given a simple program designed to take inputs of integers
from 1-1000 and to output the factorial value of that
number, how would you test this program? You do not have
access to the code. Please be as specific as possible.
Answer Posted / tudor
write some programs to take a string input assumed to be
1000! 999! 500! or 1!, test the asspumption. and ouput the
result "OK" or "NOT OK"
Pass the output of program to be tested to your programs
using some scripting
e.g:
echo "testig 1!"
echo `echo "1" > targetprogram | test1fact`
echo "testig 500!"
echo `echo "500" > targetprogram | test500fact`
...
Also should test the output for 1001, 0, xyz, -1
Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
Why Pointers are not used in C++?
Will a recursive function without an end condition every quit, in practice a) Compiler-Specific (Some can convert to an infinite loop) b) No c) Yes
We all know that a const variable needs to be initialized at the time of declaration. Then how come the program given below runs properly even when we have not initialized p?
Which is better turbo c++ or dev c++?
How many different levels of pointers are there?
What is the protected keyword used for?
What is a constant? Explain with an example.
Why do we use classes in programming?
What are single and multiple inheritances in c++?
Can the creation of operator** is allowed to perform the to-the-power-of operations?
What is code reusability in c++?
What is an undefined behavior and sequence points
How would you use the functions randomize() and random()?
Evaluate !(1&&1||1&&0) a) Error b) False c) True
Which function should be used to free the memory allocated by calloc()?