hi, I need help with PHP questions Please A unit-test-case for a function involv
ID: 3877947 • Letter: H
Question
hi, I need help with PHP questions Please
A unit-test-case for a function involves doing three things:
(a) actually___________________________
(b) specifying what the_____________________________
4. When developing unit tests, the inputs can vary from very-simple, to typical, to complex/edge-cases. In our file, what order should those tests be placed in?
a. It doesn't matter: all the unit tests will be run, so we'll find out which ones fail no matter what order we put them in.
b. Put the typical tests first, followed by the trivial and difficult test cases.
c. That way, we test the most likely real-world inputs first; the other tests are still important, but less-so.
d. First the simplest/most-trivial, then typical inputs, then difficult/borderline inputs.
e. This way, should a unit-test fail, it's easier to debug because you know the simpler tests all passed.
f. Trick question: you don't keep the trivial test-cases around (like the empty-string or an empty-array); you can delete those once you get the more complicated tests working.
g. Most complicated tests first.
h. That way, should a unit-test fail, we'll find out as soon as possible.
a. It doesn't matter: all the unit tests will be run, so we'll find out which ones fail no matter what order we put them in.
b. Put the typical tests first, followed by the trivial and difficult test cases.
c. That way, we test the most likely real-world inputs first; the other tests are still important, but less-so.
d. First the simplest/most-trivial, then typical inputs, then difficult/borderline inputs.
e. This way, should a unit-test fail, it's easier to debug because you know the simpler tests all passed.
f. Trick question: you don't keep the trivial test-cases around (like the empty-string or an empty-array); you can delete those once you get the more complicated tests working.
g. Most complicated tests first.
h. That way, should a unit-test fail, we'll find out as soon as possible.
Explanation / Answer
the main purpose of the unit testing is to test each module of your code
here module means each functions you write in your code
and each module os tested independenly, ie. the there is no data flow between the modules. this seperates the unit testing from integration testing
so for the Q4
answer which i thougt is option A
It doesn't matter: all the unit tests will be run, so we'll find out which ones fail no matter what order we put them in.
since in unit testing testing our only aim is to test each module our should not to test the complex functionality first or at last
we should check that for each functionality the test case has been written and is tested without any issue.
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.