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

Pages: 1
lmf232s
Newbie


Reged: 08/19/08
Posts: 2
What To Test And What Not To Test?
      #509765 - 08/19/08 02:03 PM

I have taken on the job of doing the unit tests for a new framework that is being developed and have never done unit testing before so bear with me.

Im Currently with a class that has 2 methods. Each of the methods accepts a combobox as a parameter and then sets its datasource, displaymember, and valuemember, there is no return value. I guess my question is:

Is this something that I can test and if so what do I test for and how?

And for future reference what can be tested and what would you generally not test.


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


Reged: 08/19/08
Posts: 2
Re: What To Test And What Not To Test? [Re: lmf232s]
      #510029 - 08/20/08 06:12 AM

Just thought I would mention that we are currently using VS 2008 Pro and will be using the Team Testing Edition in a week or so.

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


Reged: 07/10/08
Posts: 10
Re: What To Test And What Not To Test? [Re: lmf232s]
      #513940 - 09/03/08 05:14 PM

well, you can write a class with a test method that sends a set of predefined valid values into the method and validates if the values are correctly saved in the database using direct sql. if you want to break this down to each data point, that's better.

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


Reged: 02/03/09
Posts: 17
Re: What To Test And What Not To Test? [Re: Alcozz]
      #548826 - 02/08/09 06:46 AM

Unit testing refers to test "Unit" of code...In object oriented world this means testing each class and its methods.
In your case I would sure tests methods defined in the class. Pass valid parameters to this class and see that there is no error or exception...There are unit testing tools too..nUnit i believe is good for writing unit test cases for .NET

--------------------
=================================
Testing is invigorating...
http://testinginnovation.wordpress.com/


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


Reged: 03/03/11
Posts: 5
Re: What To Test And What Not To Test? [Re: TestingInnovation]
      #662999 - 03/04/11 08:48 AM

@Testing Innovation-Please Let me know the example i.e How to perform a unit testing for Class and its methods.As you are saying we should take a method with the same no of parameters as defined in the Class and can perform testing .

Thanks
Nishant


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


Reged: 10/28/04
Posts: 280
Loc: The Netherlands
Re: What To Test And What Not To Test? [Re: nkroy87]
      #667957 - 04/13/11 07:15 AM

When deciding what to test it is vital that you check with your testers and confer with them. This will prevent doing things double. Also your testers (and especially testmanager) should have an idea on what they want covered in the unit tests.

If they can not give you a clear idea on what to test and what not to then here are my guidelines:
* no risk, no test: if the code does not pose a risk then do not bother writing a test for it.
* to each his own: do not get tempted to test Microsofts code... only test functionality in your own code, frequently ask your self: "what exactly am I proving here?"
* look at code complexity when you decide what code to cover with tests and what not to.
* If you feel it smells: you need tests


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


Reged: 12/09/04
Posts: 39
Loc: India
Re: What To Test And What Not To Test? [Re: SteveHeidstra]
      #688262 - 10/12/11 05:36 AM

* Avoid testing third party controls, just do integrating testing with TP controls
* Decide if you want to test Private / Protected methods or not. It depends on risk and code complexity.

Regards,
Umesh


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


Reged: 02/13/12
Posts: 40
Loc: India
Re: What To Test And What Not To Test? [Re: mca_umesh]
      #698305 - 02/13/12 07:49 AM

UNIT testing frameworks are sucky to the core, as they are unable to generate complex class /object based data automatically from table.


However on the generic data generation part, thou shall use the tool called pairwise - from Microsoft.
[http://msdn.microsoft.com/en-us/testing/bb980925]
As I recall -- windows API testing and .NET is based on this tool.
That would solve the data generation problem.

:-)

--------------------
[May have Asperger syndrome]
[http://en.wikipedia.org/wiki/Asperger_syndrome]
Please do not get offended if I sound plain arrogant.
Bear with me, or tell me that I sound inhuman.
Thanks.


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



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

Moderator:  AJ 

Print Topic

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

Rating:
Topic views: 7730

Rate this topic

Jump to

Contact Us | Privacy statement SQAForums

Powered by UBB.threads™ 6.5.5