Re: [junit] fundamental questions on JUnit
> I dont think it can replace your print statementsbut once you have discovered, you can verify that the class acts the
> because when you are printing, you are <b> discovering
> </b> rather than <b> verifying </b>.
same way over and over again. If you keep your print statements, you're
discovering each time your run you tests, which is a lost of time.
Normally you can predict what a method will do (otherwise it tells you
something about your comprenhension of the problem you have to solve),
so if you test your program bit by bit, you should be able to predict
what it does. Right?
If you face a challenging toString() method (let's say for a complex
object), what you can do is first do a println() and then place this
result into an assertEquals(what_I_got, myObj.toString()). In that
case, you have first "discovered" the result but then verifying it with
--- In junit@y..., Vladimir Bossicard <vladimir@b...> wrote:
> I also wanted to remind that the goal is not to have 100% covered
> but 100% bug-free code.
No it isn't. The goal is a MTBD (Mean Time Between Defects) that
doesn't make you unhappy.