Fortsätt till huvudinnehåll

Inlägg

Visar inlägg från januari, 2018

Professional Test-Driven Development with C# - part II

Ok, so let's do a quick review of Part II, chapters 6 to 8, of Professional Test-Driven Development with C#. Well, I get it. I think. It is hard to write an entire book on the topic of TDD. Part II is labeled "Putting basics into action" and here the author describes, quite detailed, how he usually works. But unfortunately only a small part of it actually covers writing code. Instead a lot of pages are used to describe how to define the project, how the author and his team defines user stories, the development process they use for Agile software development and then it is framework frenzy again. Frameworks covered is this section includes, NBehave, NHibernate, Fluent NHibernate, and Ninject. The author uses those for writing a total of two unit tests and one integration test. Most of the code describes how to use the frameworks, and very little is actual implementation. So far this book is targeting a person, or team, that wants ideas on how to set up a new C# proje

Professional Test-Driven Development with C# - Review of the first 5 chapters

There is a lot of resources available online when it comes to TDD. However, I have always found that a good book is better than most online resources. Therefore I borrowed home a book called 'Professional Test-Driven Development with C#' by James Bender and Jeff McWherter. So far I am 5 chapters in to the book (about 1/3) and here is some of my reflections regarding the content: The book provides many code examples, which is positive. There is however at least one code listing that is incorrect (looks like the wrong listing was inserted). The authors put great emphasis on Red-Green-Refactor. That no application code should be written before there is a failing test for it. Still in chapter 5 they write the application code first and then add the tests later - WRONG! A lot of focus is put on the use of frameworks. I understand that you shouldn't re-invent the wheel and that choosing a good test framework, like NUnit, is a good thing to do. However, you should be careful

Does TDD really improve software quality?

I have asked myself this question several times, and searched for answers, without coming up with any clear answer. Therefore I have decided to go hard core TDD for a longer period of time (at least 6 months) to really evaluate the effects. There are several things that I find confusing when it comes to TDD. One example is what actually defines a unit test. What is a "unit" anyway? After reading a bit about it I found a text claiming that the "unit" is "a unit of work", i.e. something quite small. Like converting a string to UPPERCASE or splitting a string into an ['a','r', 'r', 'a', 'y'] of chars. This work is usually performed by a single call to a single method in a single, isolated, class. So, what does it mean that a class is isolated? Does it mean that it doesn't have any dependencies to other classes? NO! In the context of TDD it means that any dependencies are supplied by the test environment, for exa

A quick way to get started with Clojure

Wish to try out some Clojure (you really should, the need to modify existing values in memory is a thing of the past)? Take a look at Clojure Koans , a great way to get some hands on experience using Clojure. I really hope that functional programming, or at least the idea of creating new values instead of altering the location in memory of the current value, grows big. Anyone who has working with multi threaded programs knows that synchronization issues is the biggest source of really nasty bugs today. Limiting these cases to an absolute minimum would make the world of the programmer a lot less painful.