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


Please Help Members By Posting Answers For Below Questions

Why Pointers are not used in C++?

622


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

583


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?

576


Which is better turbo c++ or dev c++?

560


How many different levels of pointers are there?

652






What is the protected keyword used for?

614


What is a constant? Explain with an example.

555


Why do we use classes in programming?

570


What are single and multiple inheritances in c++?

574


Can the creation of operator** is allowed to perform the to-the-power-of operations?

578


What is code reusability in c++?

664


What is an undefined behavior and sequence points

565


How would you use the functions randomize() and random()?

627


Evaluate !(1&&1||1&&0) a) Error b) False c) True

702


Which function should be used to free the memory allocated by calloc()?

587