unit : smallest testable part of
an individual program
depends on your viewpoint !
test: a means of determining the presence, quality or
truth of something
determining “the unit” works as it is promised to?
determining the quality of “the unit” ?
determining the truth about “the unit” ?
Unit Testing : a procedure used to validate that
individual units of source code are working properly.
unit testing itself, is a procedure
unit testing applies to individual units
unit tests build-on to source code
to ensure source code is working properly
Unit testing is a white
box approach in
usually, it is
but also, it depends
on your software
isolation of units go to definition: it
refactoring code applies to individual
units, therefore it can
not guaranty the overall
system will work !
seperation of interface
from implementation it only shows the
presence of errors, not
a good habit: motivator
for decoupled, cohesive absence of errors..
code bodies, refactored
with design patterns..
step by step instructional document..
frameworks are available..
usually called xUnit frameworks..
we will investigate test driven development
methodology with nUnit framework based on
an approach for software development
actually, itself is not a lifecycle model, but an
approach for implementation phase for agile
it is a bottom-up approach..
think: write tests first, then code necessary
instructions to pass your tests..
yes, first write a test case.
then build it.. it will fail because no code
written to pass the test
implement your code as long as test case is
and voila..! YAGNI : you aint gonna need it. So,
you code as much as you need..
then think about it, how to do it better ?
is the code satisfies my requirements ?
lets assume requirements sais: if a customer
wants to transfer money, minimum balance for
the customer should be 10.00$
so, lets continue..
mock objects and their usage in unit testing..
Check out Behaviour
Watch video of Dave
( co-author of “A
practical guide to
author of award