Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

Ruby Ruby Foundations Testing Test Driven Development

Kevin Egstorf
Kevin Egstorf
26,590 Points

test-driven development versus Git

i was wondering is test-driven-development redundant when using a git repository? or do developers attend to use both when programming?

2 Answers

Maciej Czuchnowski
Maciej Czuchnowski
36,440 Points

These are two completely separate and different things, I can't see how one makes the other redundant.

You use git to be able to go back to any point in your project, see changes, enable peer review, facilitate working with other developers and store a backup copy of your project somewhere. It also lets you do experiments with features on separate branches so that they don't interfere with the main working version.

TDD is a methodology where you first write tests and then the code that makes those tests pass. And you write them before implementing any new feature. In classic methodology you write tests after writing the feature or even after completing the whole project (depends if you're using Agile or Waterfall model). In the future those tests are used to document your application and you run them to check if any new changes broke something in the app (yes, this can as well be achieved by writing tests AFTER writing the code).

Kevin Egstorf
Kevin Egstorf
26,590 Points

cool and tnx for the explanation!