Today’s blog is about Test Driven Development or TDD. In this video titled TDD – Test Driven Development ( Red | Green | Refactor ), the youtube poster details the TDD lifecycle, its importance, and an example of its application. Throughout the video, the poster highlights the advantages of TDD and why it may be the best way to help design well implemented code when it comes to code quality and code coverage.
I chose this video because I wanted to expand my knowledge on the concept of TDD in order to help with my current homework assignment. This particular concept was tough for me to grasp since I was not in class for the POGIL assignment and after reading information on it in the textbook, I felt I needed a more visual example of someone working through the TDD lifecycle from start to finish. It was also important to find a video that explained this using jUNIT.
In order to write your tests it is important to understand the specifications provided to you and account for all the ways the test could fail. One of the most important things I have learned from this video is the concept of the Red, Green, and Refractory stages of TDD. The Red stage signifies the first step in this testing strategy, being making your test fail. Before the programmer writes any code in a method that would describe its functionality, the person must first write a test that is testing a specification, but then fails due to the functionality having yet to be written. From there the programmer will write simple code that will make the pointed test pass, thus satisfying the ‘Green’ stage of TDD. From there, the youtuber continues to ‘Refactor’s’ the code to improve it without changing its behavior. He does this by making sure the behavior of the method will cover all failure possibilities. After looking over a handful of videos on this topic, this particular video was the most beneficial because it was straightforward, used a very basic test example, as well as showing different ways a person could approach this type of testing. I also appreciated his inclusion about test coverage and how this TDD method helps achieve 100% coverage. After having watched this video I have taken another look at my team’s code from the POGIL assignment that I missed and now have a better understanding of how they completed the assignment. I will be applying this poster’s methods and knowledge to my upcoming homework assignment on this topic.
Source: https://www.youtube.com/watch?v=UzRa5cLma0g
From the blog Anna The Dev by Adrianna Frazier and used with permission of the author. All other rights reserved by the author.




