Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: Fine line between integration testing and unit testing

by kvale (Monsignor)
on May 10, 2006 at 03:34 UTC ( #548374=note: print w/ replies, xml ) Need Help??


in reply to Fine line between integration testing and unit testing

In the decision between unit testing and integration testing, both is better :)

Unit testing usually refers to testing single functions or methods, while integration testing tests the compatibility among functions, methods, classes, components, etc. In practice, the distinction between unit and integration testing is blurry. For instance, a method may invoke private helper functions not accessible in the public API.

So the distinction in between unit and integration testing is not as important as testing at all levels. Start with the smallest logical units of testing, such as functions or even assertions within functions. Then work your way up the chain as you write more code.

In the context of your problem, it would make sense to mock the return value at first to test the business entities alone. Then test the data access modules with DBD::Mock, and then perform integration testing between the business entity and data access modules.

-Mark


Comment on Re: Fine line between integration testing and unit testing
Re^2: Fine line between integration testing and unit testing
by badaiaqrandista (Pilgrim) on May 10, 2006 at 06:52 UTC

    Thanks for your reply. I guess, designing tests needs the same dicipline as designing the application itself.

    --------------
    badaiaqrandista

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://548374]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (13)
As of 2014-07-10 20:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    When choosing user names for websites, I prefer to use:








    Results (215 votes), past polls