What is meant by preconditions and postconditions in a Test
Case? Can anyone give an example?

Answer Posted / pratik

a postcondition is a condition or predicate that must always
be true just after the execution of some section of code or
after an operation in a formal specification. Postconditions
are sometimes tested using assertions within the code
itself. Often, postconditions are simply included in the
documentation of the affected section of code.

For example: The result of a factorial is always an integer
and greater than or equal to 1. So a program that calculates
the factorial of an input number would have postconditions
that the result after the calculation be an integer and that
it be greater than or equal to 1.

Is This Answer Correct ?    12 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What can you tell about the project if during testing you found 80 bugs in it

1811


Why Equivalence Partitioning is called equivalence or what is the significance of equivalence term in ECP?

1628


Hi, This is vkram.I had completed my B.E in May 2005 & currently i am undergoing Testing Course. I want to join as a Fresher in any MNC. What should I tell why u r coming to testing field & what u did this 2 years?

1519


what is data guidelines

1629


test cases for compose functionality of gmail

1479






How do test documents in a project span across the software development lifecycle?

1141


how to write test cases on SRS?tell me any example which type of certification is usefull for less then 1 yr exp. people in testing. can anybody know immediatly sent it which the answer

1660


What is an inspection in software testing?

670


What are the different strategies for rollout to end users?

715


what kind of testing have u done?

1511


What and why is api testing?

943


What is QCM?

1779


How can you use technology to solve problem?

1598


write testcases for open dialogbox

1532


hi friends .......... from srs to signoff what r the tests the testing team will conduct either sequentially or parallel pls advice thanks in advance

1452