The online community for software testing & quality assurance professionals
 
 
Calendar   Today's Topics
Sponsors:
Lost Password?

Home
BetaSoft
Blogs
Jobs
Training
News
Links
Downloads



Software Testing >> Unit Testing

Pages: 1
QA_time
Member


Reged: 04/25/07
Posts: 67
Loc: India
What should be covered in Unit test cases
      #376151 - 04/26/07 05:40 AM

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)


Post Extras: Print Post   Remind Me!   Notify Moderator  
QA_Laurent
Junior Member


Reged: 01/30/02
Posts: 56
Loc: France
Re: What should be covered in Unit test cases [Re: QA_time]
      #376426 - 04/27/07 01:40 AM

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.


Post Extras: Print Post   Remind Me!   Notify Moderator  
QA_time
Member


Reged: 04/25/07
Posts: 67
Loc: India
Re: What should be covered in Unit test cases [Re: QA_Laurent]
      #376896 - 04/30/07 04:53 AM

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.


Post Extras: Print Post   Remind Me!   Notify Moderator  
Spssps
Newbie


Reged: 03/21/07
Posts: 19
Re: What should be covered in Unit test cases [Re: QA_time]
      #378553 - 05/07/07 04:48 AM

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....


Post Extras: Print Post   Remind Me!   Notify Moderator  
JakeBrake
Moderator


Reged: 12/19/00
Posts: 15290
Loc: St. Louis - Year 2025
Re: What should be covered in Unit test cases [Re: Spssps]
      #378556 - 05/07/07 04:53 AM

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.


Post Extras: Print Post   Remind Me!   Notify Moderator  
QA_time
Member


Reged: 04/25/07
Posts: 67
Loc: India
Re: What should be covered in Unit test cases [Re: JakeBrake]
      #378784 - 05/08/07 12:06 AM

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.


Post Extras: Print Post   Remind Me!   Notify Moderator  
JakeBrake
Moderator


Reged: 12/19/00
Posts: 15290
Loc: St. Louis - Year 2025
Re: What should be covered in Unit test cases [Re: QA_time]
      #378809 - 05/08/07 03:14 AM

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?


Post Extras: Print Post   Remind Me!   Notify Moderator  
Spssps
Newbie


Reged: 03/21/07
Posts: 19
Re: What should be covered in Unit test cases [Re: JakeBrake]
      #378848 - 05/08/07 04:49 AM

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.


Post Extras: Print Post   Remind Me!   Notify Moderator  
JakeBrake
Moderator


Reged: 12/19/00
Posts: 15290
Loc: St. Louis - Year 2025
Re: What should be covered in Unit test cases [Re: Spssps]
      #378939 - 05/08/07 08:19 AM

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.

Post Extras: Print Post   Remind Me!   Notify Moderator  
QA_time
Member


Reged: 04/25/07
Posts: 67
Loc: India
Re: What should be covered in Unit test cases [Re: JakeBrake]
      #379118 - 05/09/07 12:25 AM

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)

Post Extras: Print Post   Remind Me!   Notify Moderator  
QA_time
Member


Reged: 04/25/07
Posts: 67
Loc: India
Re: What should be covered in Unit test cases [Re: QA_time]
      #379119 - 05/09/07 12:26 AM

any way thanks to both of you..for sharing your knowledge

Post Extras: Print Post   Remind Me!   Notify Moderator  
JakeBrake
Moderator


Reged: 12/19/00
Posts: 15290
Loc: St. Louis - Year 2025
Re: What should be covered in Unit test cases [Re: QA_time]
      #379162 - 05/09/07 04:31 AM

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


Post Extras: Print Post   Remind Me!   Notify Moderator  
Pages: 1



Extra information
0 registered and 3 anonymous users are browsing this forum.

Moderator:  AJ, Jeanj 

Print Topic

Forum Permissions
      You cannot start new topics
      You cannot reply to topics
      HTML is disabled
      UBBCode is enabled

Rating: ***
Topic views: 4194

Rate this topic

Jump to

Contact Us | Privacy statement SQAForums

Powered by UBB.threads™ 6.5.5