Last presentation: TDD from end to end
Yesterday I presented “TDD from end to end” at Codemotion in Rome. My talk was about how to use TDD to drive the development of the whole system, from the GUI to the database. The slides contain a small solved exercise, which could be a good kata for Java servlet and JDBC skills. The techniques I showed are not my own! I’m showing things I learned from Francesco Cirillo and Carlo Bottiglieri.
The slides are in Italian, but they mostly contain Java code with English identifiers: 20110305-tdd-codemotion.pdf. Enjoy!
Update: here is the video.
March 7th, 2011 at 11:43
Sabato ho seguito il talk al Codemotion, mi è piaciuto molto. Grazie mille
March 8th, 2011 at 07:22
Grazie Annalisa!
April 7th, 2011 at 11:41
Molto interessante!
ti volevo chiedere un ulteriore step… se la prossima user story fosse “un post puo’ esser eliminato” preferiresti scrivere un test così:
@Test public void deleteRemovesBlogPost() {
final BlogPost aBlog = new BlogPost();
final List allPosts = new ArrayList(asList(aBlog));
BlogRepository repository = new BlogRepository() {
public List all() {
return allPosts;
}
public void delete(BlogPost post) {
allPost.remove(post);
}
};
repository.delete(aBlog);
assertEquals(0, repository.size());
}
oppure vorresti poter dire:
@Test public void deleteRemovesBlogPost() {
… // ?!? no idea for now…
aBlog.delete();
assertEquals(0, repository.size());
}
oppure faresti totalmente in un altro modo?
Cioè sintetizzando: assegneresti l’operazione di cancellazione al repository o al post?