spgroup / groundhog

A framework for crawling GitHub projects and raw data and to extract metrics from them
http://spgroup.github.io/groundhog
GNU General Public License v2.0
15 stars 10 forks source link

Test-Driven Development #32

Open fernandocastor opened 11 years ago

fernandocastor commented 11 years ago

I was thinking about, from now on, adopting a more test-driven approach to developing Groundhog. You guys ever heard about that? If not, take a look at http://en.wikipedia.org/wiki/Test-driven_development. I think it is very useful from specification and design perspectives, much more so than from a testing viewpoint. What do you think?

rodrigoalvesvieira commented 11 years ago

Yes, I'm very used to TDD. It's just that as a starter-level Java dev, I'm not very used to JUnit, but the way TDD frameworks work don't vary too much. I'm enthusiastic about having tests in Groundhog.

@gustavopinto, do you have previous experience with JUnit? If so, I'll ask that whenever possible you create the test structure and some initial, basic test so I can fully get how the tool works and implement other tests. We'll also have to see how we'll mock 1 the tests so that they don't actually perform requests to the forges' APIs.

fernandocastor commented 11 years ago

This is true, Rodrigo. Mocking it up will be important, since we have no control over the database (the forges).

gustavopinto commented 11 years ago

hey @rodrigoalvesvieira, I actually had committed some test code. They need improvements, I know.. In relation to mock, I highly recommend mockito. I'll plug it whenever possible.

rodrigoalvesvieira commented 11 years ago

Oh I see :)

I'll add more then when I have the time.

dnr2 commented 11 years ago

Very nice!!

I've never used this test-driven approach before, although I've already studied this subject in the software engineering course! I will take a look on this again, but I believe that it won't be a problem for me anyway.

rodrigoalvesvieira commented 11 years ago

I started a branch for the mocks https://github.com/spgroup/groundhog/tree/tests-mocking