views:

203

answers:

6

I'm working on a growing java project and I'm probably going to cooperate with somebody else to improve some features.

I'd like to use some tools to improve the quality of my work keeping in mind that:

  • I don't have too much time to spend on this project
  • it's a small project but it's really important for me
  • I don't want to buy software/hardware for it
  • I'm already using SVN

what do you think about maven and junit? is it worth spending time for them? Do you know any other good tool?

+8  A: 

Maven and JUnit are good for enforcing good habits (unit testing, uniform structure) and together with good SCM habits, I would say those are amongst the most important things for collaborative development.

Joe
+1  A: 

We use Maven and JUnit on a fairly large project and find it very helpful.

For project planning, I highly recommend FogBugz. It's the best issue tracking system I have seen to date with good support for project management as well, and free for teams of up to 2 people.

Eric J.
"free for teams for up to 2 people" sounds dangerous for a small project with growth potential. You don't want to be locked out of your issue tracker (or deny access to it for some people) if your group grows.
Joachim Sauer
It's far superior to any of the open source alternatives I have tried. If a commercial project has >2 people, it's certainly worth considering a purchase. I'm not associated with the company at all other than being a customer (it's made by the makers of Stack Overflow by the way).
Eric J.
+4  A: 

JUnit is good for helping verify your code on any project.

Maven has a learning curve that can be hard to get over. If you have one module and a relatively simple set of build steps you may find it simpler to use Ant.

On the other hand with a Maven build you can simply add additional reports to your code to check various parameters on your code, and it is much harder to migrate to Maven than if you've conformed to its conventions from the start.

Examples of Maven plugins that can help check your code:

  • Findbugs (static analysis of possible bugs)
  • Checkstyle (enforce coding standards)
  • PMD (more static analysis)
  • PMD CPD (copy paste detection)
  • JDepend (cyclic dependency checking and package coupling)
  • Cobertura (code coverage)

If you're interested in the code quality plugins, also consider Sonar, it wraps these plugins up and gives you some funky reports.

If you're interested in best practice, also consider a Continuous Integration server, Hudson is free and integrates well with Maven.

Rich Seller
+1 for findbugs
sal
+5  A: 

Since you are not using JUnit my guess is you don't have any unit tests yet. This would seem to me the most important step for you to take, if other people will start working on your code. Without unit tests, someone can easily break functionality without knowing it.

Create a suite of unit tests that cover at least 80% of the code. You can use Cobertura to measure code coverage. This might seem like a lot of work (it is) but will save you far more time in the future.

Maven is the de-facto standard for building and deployment at the moment, but it has its drawbacks too. If you have a well documented build procedure in place (either using Ant or custom scripts) I would suggest it is less important to introduce Maven than to add unit tests.

Adriaan Koster
adding tests can take months, but adding maven can take days.
01
I like Maven too - but in reality it's probably going to take more than a few days for him to 1.) learn enough about Maven to see how his existing project would fit into Maven. 2.) change his project structure to match what Maven expects (depending on how big it is and how much it differs).
Nate
A: 

If you use Eclipse and SVN I would recommend you to take a look at Mylyn. Its underlying concepts are very simple but it helps a lot when working on a team. In my modest opinion, Maven is too annoying for the real benefit of it. Maybe ant is just enough for your deployment tasks.

Juan Pablo
A: 

I've used maven on one project and miss it. There is a fairly large upfront investment though in getting it setup and configured. The XML documentation was out of date when i was working with it (perhaps this has improved). Once you get past this initial setup though it's a wonderful time saver.

As for JUnit, it's great. Use it.

Both of these tools should be treated as an investment. At first it may seem like a lot of unrelated stuff, but the project will grow more predictably with less problems over the long haul.

reccles