Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis+ 2
Negative test cases
A hammer can push a nail into a wall but cannot cut a tree, for that you need an axe ! This example certifies that negative test cases are as important as the positive ones ?š¤ Yes or no ?
3 Respostas
+ 6
So what is the negative test case here? A test to verify that a hammer can't cut a tree?
+ 5
Well I guess that would depend on the size of the tree and your willingness to pound a hammer at it, because Iām sure a hammer will knock a tree down if youāre patient or strong enough to keep at it. I think that best represents using the right tool for the job. (You wouldnt use a thousand lines of if statements to check each element in a large list when a loop can do it in 5 lines would you?)
You install a pad-lock to secure your belongings, but it turns out it never came with a code. Well your stuff is safe, but now you canāt access them either. (probably shouldāve made sure it came with a code)
+ 2
So what is the negative test case here? A test to verify that a hammer can't cut a tree? š¤š¤š¤ Yes !!