1.

What Are The Best Practices To Write A Unit Test Case?

Answer»

A FORMAL written UNIT test case is characterized by a known input and by an EXPECTED output, which is worked out before the test is executed. The known input should test a PRECONDITION and the expected output should test a postcondition.

There MUST be at least two unit test cases for each requirement: one positive test and one negative test. If a requirement has sub-requirements, each sub-requirement must have at least two test cases as positive and negative.

A formal written unit test case is characterized by a known input and by an expected output, which is worked out before the test is executed. The known input should test a precondition and the expected output should test a postcondition.

There must be at least two unit test cases for each requirement: one positive test and one negative test. If a requirement has sub-requirements, each sub-requirement must have at least two test cases as positive and negative.



Discussion

No Comment Found