小型java项目成长(maven和junit)

发布于 2024-08-06 07:24:14 字数 236 浏览 7 评论 0原文

我正在开发一个不断发展的 java 项目,并且我可能会与其他人合作来改进某些功能。

我想使用一些工具来提高我的工作质量,请记住:

  • 我没有太多时间花在这个项目上,
  • 这是一个小项目,但对我来说非常重要
  • 我不想购买软件/硬件
  • 我已经在使用 SVN

你觉得 maven 和 junit 怎么样?值得为他们花时间吗? 你还知道其他好工具吗?

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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(6

一个人的夜不怕黑 2024-08-13 07:24:15

如果您使用 Eclipse 和 SVN,我建议您看看 Mylyn。它的基本概念非常简单,但在团队合作时有很大帮助。
以我的谦虚观点,Maven 对于它的真正好处来说太烦人了。也许 ant 足以完成您的部署任务。

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.

秋风の叶未落 2024-08-13 07:24:15

我曾在一个项目上使用过 Maven,但很想念它。不过,在设置和配置方面需要相当大的前期投资。当我使用 XML 文档时,它已经过时了(也许这已经有所改进)。一旦你完成了这个初始设置,它就会节省很多时间。

至于 JUnit,它很棒。使用它。

这两种工具都应被视为一项投资。乍一看,它可能看起来像是很多不相关的东西,但从长远来看,该项目将更加可预测地发展,问题也会减少。

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.

葬花如无物 2024-08-13 07:24:14

Maven 和 JUnit 非常适合养成良好的习惯(单元测试、统一结构),再加上良好的 SCM 习惯,我认为这些是协作开发中最重要的事情之一。

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.

对你再特殊 2024-08-13 07:24:14

由于您没有使用 JUnit,我猜测您还没有任何单元测试。在我看来,如果其他人开始处理您的代码,这对您来说是最重要的一步。如果没有单元测试,有人很容易在不知情的情况下破坏功能。

创建一套覆盖至少 80% 代码的单元测试。您可以使用 Cobertura 来测量代码覆盖率。这可能看起来工作量很大(确实如此),但将来会为您节省更多时间。

Maven 是目前构建和部署的事实标准,但它也有其缺点。如果您有一个记录良好的构建过程(使用 Ant 或自定义脚本),我建议引入 Maven 不如添加单元测试重要。

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.

半衾梦 2024-08-13 07:24:14

JUnit 非常适合帮助验证任何项目的代码。

Maven 的学习曲线可能很难克服。如果您有一个模块和一组相对简单的构建步骤,您可能会发现使用 Ant 更简单。

另一方面,使用 Maven 构建,您可以简单地向代码添加额外的报告来检查代码上的各种参数,并且迁移到 Maven 比从一开始就遵守其约定要困难得多。

可以帮助检查代码的 Maven 插件示例:

如果您对代码质量插件感兴趣,还可以考虑 Sonar ,它包装了这些插件并为您提供了一些时髦的报告。

如果您对最佳实践感兴趣,还可以考虑持续集成服务器,Hudson 是免费的并且集成与 Maven 相处得很好。

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:

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.

幽蝶幻影 2024-08-13 07:24:14

我们在一个相当大的项目中使用 Maven 和 JUnit,并发现它非常有帮助。

对于项目规划,我强烈推荐 FogBugz。这是我迄今为止见过的最好的问题跟踪系统,对项目管理也提供了良好的支持,并且对最多 2 人的团队免费。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文