Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: Fine line between integration testing and unit testing

by kvale (Monsignor)
on May 10, 2006 at 03:34 UTC ( [id://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

Replies are listed 'Best First'.
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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://548374]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (4)
As of 2024-04-16 04:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found