What is Test Driven Development (TDD)? With an example

preview_player
Показать описание
A description of what test driven development is. With an example using the Java Eclipse IDE. The example is the creation of a palindrome checker through TDD.
Рекомендации по теме
Комментарии
Автор

I'm here because I don't get how TDD is done in practice. If this is how it's meant to be done, I'm never doing it.

Wineblood
Автор

I really have no idea about TDD until i watch you demo

nguyenpham
Автор

Nice tutorial on TDD. Most experienced software developers usually skip the first test. Keep in mind that unit tests are usually testing a class method's contract, i.e. for a given input what is the expected output. But unit testing can also test a segment of code within a class method.

TheAragonAD
Автор

Amazingly explained in such simple and effective manner. highly recommend. great job and Thank You !!!

AmitAg
Автор

Nice examples. As someone just trying out TDD I liked the perverse / bullheaded way you did the "least possible code to pass" - it felt almost like looking for ways to cheat the test, and that reassured me that however little code I was thinking was not too little.

myrtheattpg
Автор

Very simple. Nice code. Excelent tutorial.  Thanks from Argentina.

GonzaloMendoza
Автор

Quite good example and explanation...awaiting some more in-depth examples for implementing TDD like..DI, Mocking, Stubs etc....

amlan
Автор

Hey Mac Cole! Thanks for the comments, I would respond directly but now that YouTube switched over to their new comment system.. I can't figure it out.. Great job Google :)

To answer your question: I originally made this video in 2007. This is an updated version with HD. I was 5 years into a career as a software developer for Siemens Healthcare. Our organization had just adopted Agile Development practices with Scrum and TDD was a part of that. Since that time, I have transitioned to management and currently manage a global development team still at Siemens. Unfortunately this means I no longer code or practice TDD but I push it as much as possible with my employees :) 

Thanks again for your nice comments and using it in your cohort class. Much appreciated!

Brian 

BrianLawrence
Автор

Nice and simple explanation, thx from Switzerland :)

aymensan
Автор

Very nice and good example explaining the TDD. Thanks...

nubonde
Автор

quick and easy! awesome lil bit, got the job done!

irieb
Автор

I know this is just a quick demo, but I think it's worth pointing out that this isn't a demonstrating the significant point of TDD, which is that the design is drawn out of the tests. TDD should really test on a coarser/component level. Maybe 2 or 3 classes. Many beginners misunderstand TDD as simply writing unit tests first, then making them pass. The actual point is to draw out the design of your components. TDD done right is BDD (BDD is just adding a more descriptive vocabulary)

MrJoshua
Автор

You are correct, it is pointless to keep, and probably should be removed once you have the first actual test that does something. When I start a new project, I simply like to create a test that forces me to create the object.. just a preference and only because I like to.. Who said I need to be logical? :) Thanks for the comments, I appreciate it!

BrianLawrence
Автор

Hey! I just met you, and this is crazy! So I suscribed

nelsonalva
Автор

I'm presenting a brief segment of this vid to my cohort in Agile class BTW. I want them to see how quick and safe your refactoring goes down.

maccoleify
Автор

Can I have a copy of this code? I would like to see how it works and why I can't get my code to work.

absentphantom
Автор

Brian,

Fairly inspiring to this 40y/o non-programmer. Where were you in your career/education when you made this? Where are you now?

Mac

maccoleify
Автор

It would be nice to make a more advanced version of this tutorial by creating tests using mock objects.

TheAragonAD
Автор

Hello Sir, thanks for the tutorial, its very helpful. Also you gave many tips about writing good code. I am in the beginning of my programming career. I think logic and write code, but not that efficient. How can I improve on this. Please give some guidance. Thank you.

mvikashc
Автор

But which part of the video is which step?

Stichting_NoFa-p