testing - why writing unit test methods? -



testing - why writing unit test methods? -

i find many people wasting lot of time write hundreds of lines test applications. changing application architecture create test methods easier write. why don't test methods using. mean deed users , seek give different inputs , see if result expecting ?

i'll seek , reply more details. think argument why write ton of unit tests instead of clicking around application see if works expected. logic takes less time click few buttons write thousands of lines of code test.

i've worked in several companies public facing websites , can tell "click around" testing approach terrible. reasons:

it doesn't scale. if have non-trivial application, spend hours every release testing acting user.

it's waste. end running through same tests on , on own bias. you'll test features know best , end in routine. "i click on this, that, ... , application good!" it's waste of time if test same things.

you don't coverage. similar (2) ... think nail every part of application, won't.

it's hard re-create state. might have bug appears after user clicks on page a, b, again, d, c, a. after clicking scheme in interesting state. you'd never re-produce casual clicking.

even if find bug, you've nail tip of iceberg. have fun trying figure out method beneath ui feature problem.

i go on , on, unit tests nail these problems. there tools show how much code coverage have tests.

testing

Comments

Popular posts from this blog

web services - java.lang.NoClassDefFoundError: Could not initialize class net.sf.cglib.proxy.Enhancer -

Accessing MATLAB's unicode strings from C -

javascript - mongodb won't find my schema method in nested container -