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 we have to read to gain knowledge in banking and financial domain(software testing) for 4+ experience

1737


What makes a good test engineer?

724


What do you plan to become after say 2-5yrs (Ex: QA Manager, Why?)

1658


Hi Friends, Just One Month Back I was Join in Small Company as a Testing Eng.I have Six Month Exp. In this Company all my team memb.r fresher & PM give responsibility on us to prepare all require QC doc. for our new project.So I need ur help in this matter .How Can I start my work and Which Doc.I start to collect & From Where I get Detail Information all abt these thing. Thanks to all friends who give reply to this. Suyog

1429


what are all the possible Test Cases for VoIP based applications

1264






What is actually a rule based testing

1577


Can you please provide me the standard testcase review templete and Test plan templete.In my company we are not following any Standards templete so.Please guve me some Excell attachments.

2135


If you're given a program that will average student grades, what kinds of inputs would you use?

4412


How will you set the Dependency in the Quality center? Say if you will fail a test case and two or more test cases are dependent on that particular test case. In this case how will you handle in failing the test case.

2236


Why is it impossible to test a program thoroughly or in other terms 100% bug-free?

982


how can you test the web environment for security testing?

1444


what is the critical defect in telecom domain?help me out from this prob its very urgent

3102


what is fusion testing and impact analysis???

1679


explain ur testing project? how can u nexplain . what should we explain ? i have not worked on any project?

1773


how to write manual testcases for download the files from the template. for example:from product cost enddate

1677