QA_time
Member
Reged: 04/25/07
Posts: 67
Loc: India
|
|
Hello ,
I would like to know that what should we write in Unit test cases , in my company testing life cycle goes like this , 1) requirment analysis of application 2) Test planning 3) Test Design for Unit / Integration / System / UAT 4) Execution of Unit test cases and reporting 5) bug fixing of Unit testing 6)Execution of INtegration test cases and reporting 7) bug fixing of Integration. 8) 9) up to UAT . initially we were doing only System testing so we were writing test cases for System.. but now we have to perform Unit testing also. Can any body guide me what should I consider while writing Unit / Integration test cases.
Thanks in advance.!
Prachi
Edited by IB_QA1 (04/26/07 05:41 AM)
|
QA_Laurent
Junior Member
Reged: 01/30/02
Posts: 56
Loc: France
|
|
It's difficult to answer to your question. Unit tests are defined depending on the programs developed. Usually, there are defined by developers themselves (and maybe reviewed by QA.)
Some search on this forum (unit tests) should help you.
|
QA_time
Member
Reged: 04/25/07
Posts: 67
Loc: India
|
|
but atleast we can think of test cases based on individual unit functionality , like - A web application , it has 3 modules.we have to write Unit test cases.
so with the help of technical specification documnet , cant we prepare expected results of each function of each module ? am I making any sense ?
though it would be kind of low level test cases, but I am really confused what to cover in this level.
|
Spssps
Newbie
Reged: 03/21/07
Posts: 19
|
|
Well.. As we know the intention of unit testing is to test each unit separately to ensure that each unit is working as per the specification... So what to cover in unit test cases is 1.defenitely the functionality should work 2.Try with all the possible negative test cases to ensure that the unit handles that also. To make it clear...let us take "login" is a module in webaplication. Unit testcases for this module.... includes.. [ Assume two fields.. 1.login name(contraints:- minumum length-3, maximum-10, alphanumeric allows,no special character.) 2.password field(contraints:- minimum-3,maximum-7,atleast one special character should present,some listed special characters not allowed..etc) Follwing are some sample unit test cases.. positive testcases 1: name with length 3,password-3 (Ram,ra!)--lower 2. name with length 6,password-5 --middle 3. name with length 10,pasword-7 -- upper negative test cases.. 1. name with length 2, password- anything 2. name with length 3,password length-2 like this all the possible combinations...ideally should be there in unit testing testcases. Generally will be writing by the developers and rerun (automated) whenever some small changes do to that module....
|
JakeBrake
Moderator
Reged: 12/19/00
Posts: 15290
Loc: St. Louis - Year 2025
|
|
Santhosh,
That applies only if your definition of "unit testing" is testing via a gui. To many of us, what you have described is somewhat confusing and appears to more blackbox-based functional testing.
Developers performing unit testing typically derive test cases from looking at source code.
|
QA_time
Member
Reged: 04/25/07
Posts: 67
Loc: India
|
|
we can consider Black box approach in Unit testing , without looking code cant we test or write test cases ?
I feel Santosh is correct , we can write test cases in this manner.
|
JakeBrake
Moderator
Reged: 12/19/00
Posts: 15290
Loc: St. Louis - Year 2025
|
|
Quote:
Prachi: we can consider Black box approach in Unit testing , without looking code cant we test or write test cases ?
Are you asking a question? If you feel you are blackbox testing, that is fine. If you are to derive test cases by looking at source code as developers typically should do, then you are doing what is commonly referred to as white-box/unit testing. What does your organization think you are doing? What is their definition? That is important. . .
Quote:
Prachi: I feel Santosh is correct , we can write test cases in this manner.
That is just fine if the definition of unit testing in your organization is not white-box testing.
 Case closed?
|
Spssps
Newbie
Reged: 03/21/07
Posts: 19
|
|
Jake,
What I mentined is a technique to derive unit test cases. It doesnot matter from where you execute. This can be from GUI or command line execution or from any scripts. Consider these fields as parameters of a function and what we are doing in unit testing is invoking that function with different parameter values. The above mentioed is the way to derive those different parameter values, we can invoke the function from anywhere..We can invoke it from a Junit script(if it is java). I have confused with your word "black-box based functional testing".....Is there any categorization like "white-box based functional testing and black-box based functional tesing"? Santhosh.
|
JakeBrake
Moderator
Reged: 12/19/00
Posts: 15290
Loc: St. Louis - Year 2025
|
|
Thank you for clarifying. That is not an unusual or ungood approach. The risk is that any fixes to the code might cause the need for the overlying GUI to be changed, thus making it more costly and time-consuming. But if it works - why fix it!! Thanks again for clarifying.
|
QA_time
Member
Reged: 04/25/07
Posts: 67
Loc: India
|
|
in our organization , generally developers execute unit testing by looking their code , and then they ask tester to do Unit testing , so Testers do unit testing using Black box approach ( without looking the code)
|
QA_time
Member
Reged: 04/25/07
Posts: 67
Loc: India
|
|
any way thanks to both of you..for sharing your knowledge
|
JakeBrake
Moderator
Reged: 12/19/00
Posts: 15290
Loc: St. Louis - Year 2025
|
|
Quote:
in our organization , generally developers execute unit testing by looking their code , and then they ask tester to do Unit testing, so Testers do unit testing using Black box approach ( without looking the code)
Then it would be important for you to understand that definitions vary by organization, especially if your are looking at other organizations or you have a desire to freelance as indicated in the links below. Among many other things, definitions are key to proper expectations-setting.
http://www.sqaforums.com/showflat.php?Cat=0&Number=379120&an=0&page=0#Post379120
http://www.sqaforums.com/showflat.php?Cat=0&Number=379148&an=0&page=0#Post379148
|