简体   繁体   English

如何使我的开发工作流程更“企业化”?

[英]How can I make my development workflow more “enterprisey”?

I'm the sole developer for an academic consortium headquartered at a university in the northeast. 我是总部设在东北大学的学术联盟的唯一开发人员。 All of my development work involves internal tools, mostly in Java, so nothing that is released to the public. 我的所有开发工作都涉及内部工具,主要是Java,因此没有任何内容发布给公众。 Right now, I feel like my development workflow is very "hobbyist" and is nothing like you would see at an experienced software development firm. 现在,我觉得我的开发工作流程非常“爱好”,并且与您在经验丰富的软件开发公司看到的完全不同。 I would be inclined to say that it doesn't really matter since I'm the only developer anyway, but it can't hurt to make some changes, if for no other reason than to make my job a little easier and get a few more technologies on my resume. 我倾向于说这并不重要,因为我是唯一一个开发人员,但是如果没有其他原因,只要让我的工作变得更容易并获得一些改变就不会有任何改变。我的简历中有更多技术。 Right now my workflow is something like this: 现在我的工作流程是这样的:

  • I do most of my development work in Eclipse on my laptop. 我在笔记本电脑上的Eclipse中进行了大部分开发工作。 Everything is saved locally on my laptop, and I don't use a VCS, nor do I really backup my code (except for occasionally emailing it to myself so I can see it on a different computer - yeah, I told you my development environment needs work). 一切都保存在我的笔记本电脑本地,我没有使用VCS,也没有真正备份我的代码(偶尔通过电子邮件发送给自己,所以我可以在另一台计算机上看到它 - 是的,我告诉过你我的开发环境需要工作)。

  • When I'm done with a project and want to deploy it or if I just want to test it, I use the built-in Jar tool in Eclipse to make an executable .jar of my project. 当我完成一个项目并希望部署它或者我只是想测试它时,我使用Eclipse中的内置Jar工具来创建我的项目的可执行文件.jar。 If I use external .jar libraries, I use the Fat-Jar plugin to include those .jars in my executable .jar. 如果我使用外部.jar库,我使用Fat-Jar插件将这些.jars包含在我的可执行文件.jar中。

  • After I create the .jar, I manually upload it to the server via SFTP and test it with something like java -jar MyProject.jar . 创建.jar之后,我通过SFTP手动将其上传到服务器,并使用java -jar MyProject.jar等测试它。

Oh yeah, did I mention that I don't unit test? 哦是的,我提到过我不进行单元测试吗?

The most glaringly obvious problem that I'd like to fix first is my lack of source control. 我想首先解决的最明显的问题是我缺乏源代码控制。 I like git because of it's distributed nature, but it doesn't seem to integrate with Eclipse well and I've heard that it doesn't work very well on Windows, which is my primary development OS. 我喜欢git,因为它具有分布式特性,但它似乎没有很好地与Eclipse集成,我听说它在Windows上运行不佳,这是我的主要开发操作系统。 So, I'm leaning toward SVN, which I do have some experience with. 所以,我倾向于SVN,我确实有一些经验。 I do have my own personal server, and I think I'll use that for my source control, because I'd rather be my own admin than have to deal with university bureaucracy. 我确实拥有自己的个人服务器,我想我会将它用于我的源代码控制,因为我宁愿成为自己的管理员而不是处理大学官僚机构。 I had some trouble setting up SVN once before, but I'll give it another shot. 我之前设置SVN时遇到了一些麻烦,但是我会再试一次。 Maybe I'll also install something like Trac or Redmine for bug-tracking, todo list, etc? 也许我还会安装像Trac或Redmine这样的bug跟踪,待办事项列表等等?

What about building and deployment? 那么构建和部署呢? There has to be a better way than using Fat-Jar and manually uploading my jar to the server. 必须有比使用Fat-Jar更好的方法并手动将我的jar上传到服务器。 I've heard about tools like Ant and Maven - do these apply to what I want to do? 我听说过像Ant和Maven这样的工具 - 这些适用于我想做的事情吗? How can I get started using those? 我怎样才能开始使用它们?

I suppose I'd eventually like to integrate unit testing with JUnit too. 我想我最终也希望将单元测试与JUnit集成。 Even though it probably should be, that is not my primary concern right now, because so far my applications aren't terribly complex. 虽然它可能应该是,但这不是我现在主要关注的问题,因为到目前为止我的应用程序并不是非常复杂。 I'd really like to work on simplifying and streamlining my workflow right now, and then I'll ease into unit testing. 我现在非常想简化和简化我的工作流程,然后我会轻松进行单元测试。

Sorry for the long question. 很抱歉这个问题很长。 I guess my question boils down to, for a sole developer, what tools and methodologies can/should I be using to not only make my job easier, but also just to expose myself to some technologies that would be expected requisite knowledge at a dedicated development house? 我想我的问题归结为,对于一个唯一的开发人员,我可以/应该使用哪些工具和方法,不仅可以使我的工作更轻松,而且还可以让我自己接触一些在专门开发中需要的必备知识的技术屋?


edit: Thanks for the great answers so far. 编辑:感谢目前为止的精彩答案。 I didn't mean to suggest that I wanted to make my workflow "enterprisey" just for the sake of doing it, but to make my job simpler and to get a few technologies under my belt that are typically used in enterprise development environments. 我并不是说我想让我的工作流程“企业化”只是为了做到这一点,而是为了让我的工作变得更简单,并获得一些通常用于企业开发环境的技术。 That's all I meant by that. 这就是我的意思。

It seems to me like you actually have a pretty good idea of what you need to do. 在我看来,你实际上对你需要做的事情非常了解。

Using Subversion (or other VCS) is a must. 使用Subversion(或其他VCS)是必须的。 Although it might be wise to setup a separate SVN repository for your work-related code rather than using a personal one. 虽然为您的工作相关代码设置单独的SVN存储库而不是使用个人代码可能是明智之举。

You can integrate Subversion with Eclipse using a plugin like Subclipse, which I've found works pretty well. 您可以使用像Subclipse这样的插件将Subversion与Eclipse集成,我发现它非常适合。

I'd definitely use Ant or Maven - my preference is Ant because it's more flexible, and I think it would suit your development style more than Maven as well. 我肯定会使用Ant或Maven - 我的偏好是Ant,因为它更灵活,我认为它也比Maven更适合你的开发风格。 But you might also want to look into Apache Ivy , which handles dependency-management. 但您可能还需要研究处理依赖关系管理的Apache Ivy

Basically you set up an ant task which runs your compile, build and deployment steps - so that when you create a final JAR package you can be sure that it's been unit tested as that is part of your ant script. 基本上你设置了一个运行编译,构建和部署步骤的ant任务 - 这样当你创建一个最终的JAR包时,你可以确定它已经过单元测试,因为它是你的ant脚本的一部分。 The best way to get started with ant is to look at some examples, and read through the manual . 开始使用ant的最佳方法是查看一些示例,并阅读手册

As for unit testing - you can gradually build up with unit testing. 至于单元测试 - 您可以逐步建立单元测试。 I would recommend using JUnit in conjunction with a code coverage tool such as Cobertura (which is easy to set up) - it will help you to understand how much code your tests are covering and is an indicator about how effective your tests are. 我建议将JUnit与代码覆盖工具(如Cobertura (易于设置))结合使用 - 它将帮助您了解测试所覆盖的代码量,并指示测试的有效性。

It may also be worth your while setting up something like Trac - it's important to be able to keep track of bugs, and a wiki is surprisingly useful for documentation. 在设置像Trac这样的东西时也值得你这么做 - 能够跟踪bug是很重要的,而wiki对文档来说非常有用。

In other words, all of this sounds like you're on the right lines, you just need to get started using some of these tools! 换句话说,所有这些听起来都像是在正确的线上,你只需要开始使用这些工具!

If you're really set on distributed source control, I'd recommend you look at Bazaar . 如果你真的开始使用分布式源代码控制,我建议你看看Bazaar Its GIT-like distributed source control that's designed around performing very high quality merges. 它的GIT类似分布式源代码控制,旨在执行非常高质量的合并。 Out of the box it works on all platforms including Windows and they have a TortoiseBZR client. 开箱即用它适用于所有平台,包括Windows,他们有一个TortoiseBZR客户端。

Really though, any source control is better than none. 实际上,任何源代码控制都比没有好。 If you're the sole developer then there's no need for anything more complex than SVN. 如果您是唯一的开发人员,那么就不需要比SVN更复杂的东西了。 Large companies and projects use SVN all the time with little issue. 大型公司和项目始终使用SVN,几乎没有问题。

As far as unit testing goes, you should make yourself familiar with JUnit . 就单元测试而言,你应该熟悉JUnit The fact that you're aware of unit testing and know you should be doing it is still several steps ahead of most ad-hoc developers. 您知道单元测试并知道您应该这样做的事实仍然比大多数临时开发人员领先几步。

Use version control. 使用版本控制。 Period. 期。 SVN has great intergration with Eclipse and Windows. SVN与Eclipse和Windows有很好的集成。 Get the TourtisSVN client for windows and use the subclipse plugin with Eclipse. 获取Windows的TourtisSVN客户端并使用Eclipse的subclipse插件。

I would recomend getting an external HD or use one of your companies' servers for putting your repository on and do backups often. 我建议购买外置高清或使用贵公司的服务器来存放您的存储库并经常进行备份。 Subversion works great with deployment and upgrading as well. Subversion也适用于部署和升级。 Just learn how to do it and you will never look back :) 只是学习如何做到这一点,你永远不会回头:)

As far as Unit Testing, some people would say that is the way to go but I have not found enough evidence to start the practice myself. 对于单元测试,有些人会说这是要走的路,但我没有找到足够的证据来自己开始练习。 If sombody on this question can convince me otherwise then please do! 如果这个问题上的sombody可以说服我,那么请做!

Also, don't look to "enterprise" your workflow - look to make it better. 此外,不要将“企业”视为您的工作流程 - 希望使其更好。 Practices that work well with huge teams and corperations may not work well for you. 适用于大型团队和合作的实践可能不适合您。 I am pretty much an only developer myself and know the situation you are in. Just try everything and only keep what feels natural after a while. 我自己几乎是一个唯一的开发人员,并且知道你所处的情况。只需尝试一切,只保留一段时间后感觉自然。

But make sure to just try SVN! 但请务必尝试SVN! If your company has a LINUX server with apache see if you can set up your server there using DAV-SVN. 如果您的公司有一个带Apache的LINUX服务器,请查看您是否可以使用DAV-SVN在那里设置服务器。

:) :)

I think you answered most of your own questions. 我想你回答了大部分自己的问题。

  • Source control: pick SVN - easy installation, great integration with Eclipse (subclipse). 源代码控制:选择SVN - 易于安装,与Eclipse(subclipse)的完美集成。
  • Use Ant to build your project and deploy it (SCP/SFTP task) 使用Ant构建项目并进行部署(SCP / SFTP任务)
  • Keep all your settings (Eclipse project settings, build xmls, etc.) in SVN. 在SVN中保留所有设置(Eclipse项目设置,构建xmls等)。
  • Use Bugzilla to keep track of your bugs/issues/requests/ideas. 使用Bugzilla来跟踪您的错误/问题/请求/想法。

It would be VERY beneficial to start working with version control. 开始使用版本控制非常有用。 Start now, don't delay! 从现在开始,不要拖延! Git is moving REALLY fast, and there's already a TortoiseGit being developed. Git正在快速移动,并且已经开发了TortoiseGit。 SVN is still a great standard to work with. SVN仍然是一个很好的标准。 And I have not worked with Mercurial, but that's another VCS that's worth looking into. 我没有和Mercurial合作过,但那是另一个值得研究的VCS。

Other than that, I don't see why your workflow has to be enterprisey. 除此之外,我不明白为什么你的工作流程必须是企业的。 It just has to be efficient and comfortable. 它必须高效舒适。 That said, I think you should try working with a simple text editor and compiling from the command line. 也就是说,我认为您应该尝试使用简单的文本编辑器并从命令行进行编译。 Most of the world's best programmers still use that instead of an IDE, and it will help you understand the processes underneath your favorite IDE. 大多数世界上最好的程序员仍然使用它而不是IDE,它将帮助您理解您喜欢的IDE下面的过程。

Check out the Pragmatic Programmers' Pragmatic Starter Kit . 查看Pragmatic Programmers的实用入门套件

It schools you on the important basics of software development that universities/etc. 它让您了解大学/等的软件开发的重要基础知识。 seem to pass up, like version control, unit testing, and project automation (in that order), and does it in a very approachable manner. 似乎放弃了,如版本控制,单元测试和项目自动化(按此顺序),并以非常平易近人的方式进行。

It will give you a solid base to keep going from there. 它将为您提供坚实的基础,让您继续前进。

All the previous comments covered almost everything you might ever need :-) 之前的所有评论几乎涵盖了您可能需要的所有内容:-)

I want to add another approach on how to develop (the development workflow). 我想在如何开发(开发工作流程)上添加另一种方法。

I suggest that you read the following article and although it's a git workflow you can use the same idea for any other tool you might be using. 我建议您阅读以下文章,虽然它是一个git工作流程,但您可以对您可能使用的任何其他工具使用相同的想法。

http://nvie.com/posts/a-successful-git-branching-model/ http://nvie.com/posts/a-successful-git-branching-model/

Take a look @ Matt Raible's Appfuse. 看看@Matt Raible的Appfuse。

It incorporates Maven and Unit Testing. 它结合了Maven和单元测试。

http://raibledesigns.com/rd/tags/appfuse http://raibledesigns.com/rd/tags/appfuse

Once you have a set up version control and a few unit-tests, I would consider a continous integration server (you wanted to be enterprisey, right?). 一旦你有一个设置版本控制和一些单元测试,我会考虑一个连续的集成服务器(你想成为企业,对吧?)。

Even if you are and stay the sole developer, this might help you to uncover a few errors. 即使您是并且仍然是唯一的开发人员,这可能会帮助您发现一些错误。 Things you forgot to check in or the likes. 你忘记办理登机手续或喜欢的事情。 A CI-server regularly checks out all your sources, does a clean build an runs all your tests. CI服务器定期检查所有源,干净的构建运行所有测试。 It also contacts you in the case of errors. 如果出现错误,它也会与您联系。

This gives you the guarantee that you (or any other person) is able to check out your code and build/run your projects. 这可以保证您(或任何其他人)能够检查您的代码并构建/运行您的项目。

I would recommend to take a look at Hudson 我建议看看哈德森

Although you put it as the last thing, I think you should start using jUnit without delay. 虽然你把它作为最后一件事,但我认为你应该毫不拖延地开始使用jUnit。

The reason is, it's probably the easiest of the ambitions you've identified, and the tools are almost certainly already built into your Eclipse build. 原因是,它可能是您已经确定的最容易实现的目标,并且这些工具几乎肯定已经内置到Eclipse构建中。

Make a new folder in your project called 'jUnit'. 在项目中创建一个名为“jUnit”的新文件夹。

Let's say you have an Employee class, with setAnnualSalary() and getMonthlySalary() methods. 假设您有一个Employee类,使用setAnnualSalary()和getMonthlySalary()方法。

Right click on the jUunit folder, new -> "jUnit test case". 右键单击jUunit文件夹,new - >“jUnit test case”。 This will make a new class. 这将成为一个新的课程。 Call it TestEmployee. 称之为TestEmployee。 Eclipse generates the boilerplate stuff for you, as usual. Eclipse像往常一样为您生成样板文件。

Add a void method with a name beginning with 'test': 添加名称以'test'开头的void方法:

public void testSalaryCalc() {
    Employee emp = new Employee("John Doe");
    emp.setAnnualSalary(12000);
    assertEquals(1000,emp.getMonthlySalary());
}

Right click, "run as" -> "jUnit test". 右键单击“运行方式” - >“jUnit test”。 (the first time Eclipse may prompt you to do some setup for the project. Just do what it says.) (Eclipse第一次可能会提示你为项目做一些设置。就像它说的那样。)

If Employee works properly, you'll see a green bar. 如果员工工作正常,您将看到一个绿色栏。 Sabotage the Employee class, run the test again, and you'll see a red bar, as well as output telling you what the failure was. 破坏Employee类,再次运行测试,你会看到一个红色条,以及输出告诉你失败是什么。

Congratulations: you are unit testing! 恭喜:您正在进行单元测试!

Right-clicking on the parent directory and choosing "Run as jUnit test" will run every Testcase class in the directory. 右键单击父目录并选择“Run as jUnit test”将运行目录中的每个Testcase类。 Later you can incorporate jUnit into your build process, but don't worry about that for now. 稍后您可以将jUnit合并到构建过程中,但现在不用担心。

Autocomplete will show you all the variations on assert() you can use. 自动填充功能会向您显示您可以使用的assert()所有变体。 You can read up on it, and aim towards practices where you write the test cases before the implementation that passes them. 您可以阅读它,并针对在您通过它们的实现之前编写测试用例的实践。 But just doing the simple stuff above gets you big benefits. 但只要做上面这些简单的事情就可以获得很大的好处。

Like others have said, you already clearly know what you need to do. 像其他人所说,你已经清楚地知道你需要做什么。 A VCS is a must, CI or bug-tracking may be overkill (for a single developer a spreadsheet might suffice for bug-tracking). VCS是必须的,CI或错误跟踪可能是过度的(对于单个开发人员来说,电子表格可能足以进行错误跟踪)。

One thing that might benefit you greatly is keeping an organized product backlog. 可能对您有益的一件事是保持有组织的产品积压。 In solo development, I find keeping focused on the high-priority features and avoiding feature creep to be one of my biggest challenges. 在单独开发中,我发现专注于高优先级功能并避免功能蔓延成为我最大的挑战之一。 Keeping a backlog helps immensely. 保持积压有助于极大地。 It doesn't have to be much more than a prioritized list of features with some notes about the scope of each. 它不一定只是一个优先级的功能列表,并且有一些关于每个功能范围的注释。 At my workplace, we keep this info in Trac, but here again, a spreadsheet may be all you need. 在我的工作场所,我们将此信息保存在Trac中,但在这里,您可能只需要一个电子表格。

And I want to put in a plug for unit testing, particularly Test Driven Development (TDD). 我想插入一个单元测试插件,特别是测试驱动开发(TDD)。 Kent Beck's book is a good place to start. Kent Beck的书是一个很好的起点。 I find that TDD helps keep me honest and focused on what I really need to do, particularly on a single-developer project without QA. 我发现TDD有助于让我保持诚实,专注于我真正需要做的事情,特别是在没有QA的单一开发人员项目上。 Sometimes it seems like the code writes itself. 有时似乎代码会自行编写。

You got some really solid answers so short post adding a link to an article about Test Driven Development which is an agile practice that will look good on your CV. 你有一些非常可靠的答案如此简短的帖子添加了一篇关于测试驱动开发的文章的链接,这是一个敏捷的练习,在你的简历上会很好看。 TDD TDD

If you are running a Windows Server where you want to put your SVN server, use Visual SVN as the server. 如果您正在运行要放置SVN服务器的Windows Server,请使用Visual SVN作为服务器。 It is super easy to setup and use, it supports both basic authentication and windows authentication. 它易于设置和使用,它支持基本身份验证和Windows身份验证。 It is also free to use. 它也是免费使用的。

Eclipse has quite a few modules to integrate with a SVN server, so use one of those, or the already suggested Tortoise SVN. Eclipse有很多模块可以与SVN服务器集成,因此请使用其中一个或已经建议的Tortoise SVN。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM