Recently a friend of mine found out she was pregnant. She was really stressed because she had a miscarriage just a little while ago. To reduce her stress level, the doctor prescribed an ultrasound (a test) even though it was early in the pregnancy. This story made ​​me think that, for me, TDD is a little bit like a test prescribed by a doctor. It allows me to reduce my stress level when I develop a new feature, especially when there are many unknowns. TDD helps reduce my stress, because it allows me to step into the unknown in small steps and gradually validate that I’m going in the right direction. Here’s an example: In my current term, I was asked to display both the title and description of a parameter from a DITA file (contextual help). My stress level at that time was very high because I never worked with this type of file. So, here’s how I reduced my stress: Test 1: Read the documentation about the DITA file. – After a simple reading, I realized it was just an XML file. Test 2: Test read the file – The test was simply to open the file and parse it in a document. Test 3: Fetch the parameter title. – The test was to read in the file and retrieving the title from an ID attribute. After a dozen tests, I had removed all the unknown… And the most interesting is that the feature was almost finished. Having no stress, I could take the time to make sure my code was clean and that it met our definition of ‘done’. So, do you some good, do some TDD!

gabriel bélanger

Previous post

Pyxis’ new team

Next post

Pyxis partenaire de l'Agilité