Posts Tagged ‘Testing’

TDD vs After Testing (1/2)

Tuesday, June 16th, 2009

tdd From the perspective of someone who practices Test-Driven Development, this gets things backwards. I believe that it is an essential part of Test-Driven Development that you must write your unit test before writing any application code. Why does it matter?

Test-Driven Development is first and foremost an application design methodology. If you write your unit tests after you write your application code, then you are not driving the design of your application with your unit tests. In other words, Test-After Development ignores the Driven in Test-Driven Development.

Let’s consider a concrete scenario …

(more…)

Test, test and test (I forgot … More test!)

Wednesday, May 6th, 2009

We are already able to say that a software development without automated testing is unacceptable. We can distinguish among unit, functional, integration and more, but the idea of automating is great!!! If we focus on unit test we will see that it is apparently easier to implement, although it is not trivial to be able to do testing that truly tests the functionality and, even better, that can be almost complete. TDD and “First Test” help to make all this even more believable (for unbelievers) and further encourage those who live it as an act of faith.

As a first post of automated tests, we could identify (among many things) some advantages of this practice:

  1. All tests are regression tests.
  2. The continuous integration makes better tests.
  3. We lose the fear towards code refactoring.
  4. Agile development is successful because of the tests.
  5. Those who test the code with a “main” to see if it is working … What is the difference between that time and writing a real test that will also help us throughout the project?
  6. We know exactly which change caused a compatibility bug (instead of knowing in what month it occurred).
  7. No need to remember the whole code. If you forget what the subject was, you can go and see the tests for that functionality.
  8. The design of the application tends to be better and less decoupled.
  9. You go to bed with peace of mind! You know the code you touched did not break anything (that has tests).