程序员如何协同完成一个项目?

发布于 2024-09-05 04:46:52 字数 198 浏览 4 评论 0原文

我一直都是独自编程,我还是一名学生,所以我从来没有和其他人一起编程,我以前甚至没有使用过版本控制系统。

我现在正在开发一个项目,该项目需要了解程序员如何在公司中一起开发软件。

软件是如何编译的?是来自版本控制系统吗?是个人程序员做的吗?是周期性的吗?是当有人决定建造什么的时候吗?是否进行了任何测试以确保其“有效”?

任何事情都会做。

I've always programmed alone, I'm still a student so I never programmed with anyone else, I haven't even used a version control system before.

I'm working on a project now that requires knowledge of how programmers work together on a piece of software in a company.

How is the software compiled? Is it from the version control system? Is it by individual programmers? Is it periodic? Is it when someone decides to build or something? Are there any tests that are done to make sure it "works"?

Anything will do.

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

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

发布评论

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

评论(13

国产ˉ祖宗 2024-09-12 04:46:52

事实上,有多少家公司,这些流程就有多少变化。含义:每个公司的惯例都与其他公司略有不同,但有一些通用的最佳实践在大多数地方都普遍使用。

始终有用的最佳实践

  • 所有项目的源代码以及构建项目所需的任何内容都在版本控制(也称为源代码控制)之下。 任何人都应该能够一键构建整个项目。
    此外,不应将不必要的文件(目标文件或编译的二进制文件)添加到存储库中,因为它们可以很容易地重新生成,并且只会浪费存储库中的空间。
  • 每个开发人员都应该每天多次更新提交版本控制。大多数情况下,当他们完成正在处理的任务并对其进行足够的测试时,他们知道它不包含微不足道的错误。
  • 再次强调:任何人都应该能够通过单击来构建项目。这很重要,并且使每个人都可以轻松进行测试。如果非程序员(例如老板)也能够这样做,那就有很大的优势了。 (这让他们感觉能够准确地看到团队正在做什么。)
  • 每个开发人员应该测试他们添加的新功能或错误修复在提交之前到存储库。
  • 设置一个服务器,定期(以预定的时间间隔)从存储库更新自身,并尝试在整个项目中构建所有内容。如果失败,它会向团队发送电子邮件以及对版本控制的最新提交(从哪个提交开始构建失败)以帮助调试问题。
    这种做法称为持续集成,构建也称为夜间构建
    (这并不意味着开发人员不应在自己的机器上构建和测试代码。如上所述,他们应该这样做。)
  • 显然,每个人都应该熟悉有了项目的基本设计/架构,因此如果需要某些东西,团队的不同成员不必重新发明轮子。编写可重用的代码是一件好事。
  • 团队成员之间需要某种沟通。每个人都应该知道其他人在做什么,至少知道一点。越多越好。这就是为什么每日站会在 SCRUM 团队中非常有用。
  • 单元测试是一种非常好的实践,可以自动测试代码的基本功能。
  • 错误跟踪软件(有时称为时间跟踪软件)是跟踪存在哪些错误以及不同团队成员有哪些任务的非常好的方法。它也有利于测试:项目的 alpha/beta 测试人员可以通过这种方式与开发团队进行沟通。

这些简单的事情可以确保项目不会失控,并且每个人都使用相同版本的代码。当事情变得非常糟糕时,持续集成过程会有所帮助。

它还可以防止人们提交未构建到主存储库的内容。
如果您想要包含一项需要数天时间才能实现的新功能,并且会阻止其他人构建(和测试)项目,请使用版本控制的分支功能。

如果这还不够,您还可以将其设置为进行自动化测试(如果相关项目可以的话)。

更多想法

乍一看,上面的列表可能非常重量级。我建议您根据需要遵循它:从版本控制和错误跟踪器开始,然后在需要时设置持续集成服务器。 (如果这是一个大型项目,您很快就会需要它。)开始为最重要的部分编写单元测试。如果还不够,那就多写一些。

一些有用的链接:
持续集成每日构建是您的朋友版本控制 , 单元测试

示例:

对于版本控制,我倾向于使用 Git 用于我现在的个人项目。 Subversion 也很流行,例如 VisualSVN 如果您使用 Windows 服务器,则设置起来非常容易。对于客户来说,TortoiseSVN 最适合很多人。 这是 Git 和 SVN 之间的比较。

对于错误跟踪软件,JiraBugzilla 非常受欢迎。我们还在之前的工作场所使用了 Mantis

对于持续集成软件,有 Teamcity 之一(还有 CruiseControl 及其 .NET 对应项 值得注意)。

回答你的问题“项目的主体设计由谁决定?”

当然,那将是首席开发人员。
在公司中,首席开发人员是与项目的财务/营销人员交谈的人,并根据公司的财务能力、计划的功能、用户的需求以及可用的时间来决定架构。

这是一项复杂的任务,通常涉及多个人。有时,团队成员也会被要求参与或集思广益,讨论整个项目或特定部分的设计。

Actually, there are as many variations on these processes as many companies there are. Meaning: every company has a little bit different conventions than others, but there are some common best practices that are generally used in most places.

Best practices that are always useful

  • All the source code of the project and anything that is required to build it is under version control (also called source control). Anyone should be able to build the entire project with one click.
    Furthermore, unnecessary files (object files or compiled binaries) should not be added to the repository, as they can be regenerated quite easily and would just waste space in the repo.
  • Every developer should update and commit to the version control a few times per day. Mostly when they have finished the task they are working on and tested it enough so they know that it doesn't contain trivial bugs.
  • Again: anyone should be able to build the project with a single click. This is important and makes it easy to test for everyone. Big advantage if non-programmers (eg. the boss) are able to do so, too. (It makes them feel to be able to see what the team is working on exactly.)
  • Every developer should test the new feature or bug fix they are adding before they commit those to the repository.
  • Set up a server that regulary (in predetermined intervals) updates itself from the repository and tries to build everything in the entire project. If it fails, it sends e-mails to the team along with the latest commits to the version control (since which commit did it fail to build) to help debug the issue.
    This practice is called continuous integration and the builds are also called nightly builds.
    (This doesn't imply that developers should not build and test the code on their own machines. As mentioned above, they should do that.)
  • Obviously, everyone should be familiar with the basic design/architecture of the project, so if something is needed, different members of the team doesn't have to reinvent the wheel. Writing reusable code is a good thing.
  • Some sort of communication is needed between the team members. Everyone should be aware of what the others are doing, at least a little. The more, the better. This is why the daily standup is useful in SCRUM teams.
  • Unit testing is a very good practice that makes testing the basic functionality of your code automatically.
  • A bug tracking software (sometimes called time tracking software) is a very good means of keeping track what bugs are there and what tasks the different team members have. It is also good for testing: the alpha/beta testers of your project could communicate with the development team this way.

These simple things ensure that the project doesn't go out of control and everyone works on the same version of the code. The continuos integration process helps when something goes terribly bad.

It also prevents people from committing stuff that don't build to the main repository.
If you want to include a new feature that would take days to implement and it would block other people from building (and testing) the project, use the branches feature of your version control.

If that is not enough, you can set it up to do automated testing, too, if that is possible with the project in question.

Some more thoughts

The above list can be very heavyweight at first glance. I recommend that you follow it on an as-needed basis: start with a version control and a bug tracker, then later on set up the continuous integration server, if you need it. (If it's a large project, you're gonna need it very soon.) Start writing unit tests for the most important parts. If it's not enough, then write more of them.

Some useful links:
Continuous integration, Daily builds are your friends, Version control, Unit testing

Examples:

For version control, I tend to use Git for my personal projects nowadays. Subversion is also popular, and for example, VisualSVN is quite easy to set up if you use a Windows server. For client, TortoiseSVN works best for many people. Here is a comparison between Git and SVN.

For bug tracking software, Jira and Bugzilla are very popular. We also used Mantis at a previous workplace.

For continuous integration software, there is Teamcity for one (also, CruiseControl and its .NET counterpart are notable).

Answer to your question "who decides the main design of the project?"

Of course, that would be the lead developer.
In companies, the lead developer is the person who talks to the financial / marketing people of the project, and decides the arcithecture according to the financial capability of the company, the planned features the requirements from users, and the time that is available.

It is a complex task, and usually more than one people are involved. Sometimes members of the team are also asked to participate or brainstorm about the design of the entire project or specific parts.

绾颜 2024-09-12 04:46:52

我也是一名学生,最近完成了软件工程课程,整个学期包括一个巨大的小组项目。首先我要说的是,我们 12 个人花了整个学期才能完成的事情,我们 3 个人就可以完成。与人合作是一件艰难的事情。沟通是关键。

一定要使用存储库。每个人都可以远程访问所有代码,并添加/删除/更改任何内容。但关于颠覆的最好的部分是,如果有人破坏了代码,您可以恢复到早期版本并从那里评估出了什么问题。不过,沟通仍然很关键,了解你的队友在做什么,这样就不会发生冲突。也不要坐在代码上,快速、有意义地向存储库提交才是最有效的。

**我还推荐一个错误跟踪器,例如Redmine。您可以为每个人设置帐户,并为人员分配不同优先级的任务,还可以跟踪并查看人们是否已经解决了某些问题,或者是否出现了更多问题。

而且,正如之前所说,单元测试会有很大帮助。祝你好运!希望这有帮助:-)

I'm a student as well, who completed a software engineering course recently where the entire semester consisted of a giant group project. Let me just start by saying we could have done with 3 people what it took 12 of us the whole semester to do. Working with people is a tough thing. Communication is key.

Definitely utilize a repository. Each person can remotely access all the code, and add/delete/change anything. But the best part about subversion is that if someone breaks the code, your can revert to an earlier version and assess what went wrong from there. Communication is still key though, know what your teammates are doing so that there are no conflicts. Don't sit on your code either, make quick, meaningful commits to the repository to be the most effective.

**I'd also recommend a bug tracker, such as Redmine. You can set up accounts for everyone, and assign people tasks with different priorities, and also track and see if people have taken care of certain problems, or if more have come up.

And, as has been said before, unit testing will help greatly. Best of luck! Hope this helped :-)

铃予 2024-09-12 04:46:52

程序员如何一起工作
公司的一个软件

开发人员从来不作为一个团队工作。团队很糟糕。 呆伯特很有趣,并不是因为他是像高飞这样的滑稽角色。他很有趣,因为他是真实的,人们认识他所处的情况。

Comic

how programmers work together on a
piece of software in a company

Developers never work as a team. Teams suck. Dilbert is funny not because he's a comical character like Goofy. He's funny because he's real and people recognize the situations he's in.

Comic

世界等同你 2024-09-12 04:46:52

一般来说,最好不要将构建工件签入存储库。存储库将包含源代码树、构建配置等——任何由人类编写的内容。软件工程师将把他们的代码副本检出到本地文件系统上并在本地构建它。

将单元测试作为构建过程的一部分运行也是一种很好的做法。这样,开发人员将立即知道他的更改是否使任何单元测试无效,并且有机会在签入他的更改之前修复它们。

您可能想查看版本控制系统(Subversion、CVS、Git 等之一)和构建系统(例如,Java 中的 Ant 和 Maven)的文档。

Generally it is good practice not to check build artifacts into the repository. The repository will contain the source tree, build configuration, etc - anything written by a human. Software engineers will check out a copy of their code onto their local filesystem and build it locally.

It is also good practice to have unit tests which are run as part of the build process. This way, a developer will know instantly if his changes have invalidated any of the unit tests, and will have the opportunity to fix them before checking in his changes.

You might like to look into the documentation for a version control system (one of Subversion, CVS, Git, etc) and for a build system (for example, in Java there are Ant and Maven).

可爱暴击 2024-09-12 04:46:52

最重要的是:

  • 计划——如果人们不知道他们要去哪里,他们就不会去任何地方。因此,任何项目的开始都需要几个人(通常是项目白胡子)聚在一起制定计划;该计划不需要非常详细,但仍然是必需的。
  • 版本控制系统——没有这个系统,你们就无法一起工作。你还需要坚定的承诺,如果事情没有承诺,那么它们就不算数。 “哦,它在我的一个沙箱里”只是一个蹩脚的借口。
  • 问题跟踪器 - 您无法通过电子邮件文件夹跟踪这些内容。绝对应该是数据库支持的。
  • 通知系统 - 人们需要知道何时将事情提交给他们维护的代码或何时对他们负责的错误进行评论。电子邮件可以解决这个问题,IRC 也可以(当然,前提是每个人都使用它)。
  • 构建系统 - 这种情况如何发生并不重要,只要通过一个操作就可以完整构建当前的状态,无论是开发还是开发沙箱和主存储库。最佳选择取决于您使用的语言。
  • 测试套件 - 测试套件可以帮助人们避免愚蠢的错误。它需要像构建一样易于运行(成为构建的一部分)。请注意,测试只是正确性的粗略替代品,但总比没有好得多。

最后,您需要愿意共同努力实现计划。这往往是最困难的部分。

The big things are:

  • A plan — If people don't know where they're going, they won't go anywhere. The start of any project therefore needs a few people (often the project graybeards) to get into a huddle and come up with a plan; the plan need not be very detailed, but it's still required.
  • Version control system — Without this, you aren't working together. You also need the firm commitment that if things aren't committed, they don't count. “Oh, it's in one of my sandboxes” is just a lame excuse.
  • Issue tracker — You can't keep track of these things by email folders. Should definitely be database-backed.
  • Notification system — People need to know when things are committed to code that they maintain or comments are made to bugs they are responsible for. Email can work for this, as can IRC (provided everyone uses it, of course).
  • Build system — It doesn't really matter how this happens, so long as with one action you can get a complete build of the current state of things, both of your development sandbox and of the main repository. The best option for this depends on what language(s) you're using.
  • Test suite — A test suite helps people avoid silly errors. It needs to be as easy to run as the build (being part of the build is good). Note that tests are only a crude substitute for correctness, but they're a heck of a lot better than nothing.

Finally, you need a willingness to work together toward fulfilling the plan. That's all too often the tough part.

围归者 2024-09-12 04:46:52

你问的问题没有标准。相反,有一些惯例,这些惯例在很大程度上取决于组织的规模和成熟度。如果您在一个小型组织中,例如几个程序员,那么个别开发人员进行编码、构建和测试的情况可能会有些非正式。

在较大的组织中,可能有专门的构建工程师和流程。这种组织通常会使用签入的任何源代码定期进行正式构建,例如每天一次。该过程通常还包括 BVT(构建验证测试)以及可能的一些回归测试。开发人员将从存储库中检查代码,在本地处理自己的部分,然后将其签入。

在最大的组织中,例如微软或谷歌,他们将拥有一个完全专用的小组和完整的实验室,该实验室将构建在更多或更多的基础上-更少的连续基础,使每次运行的结果都可用。这些组织拥有非常正式的流程和程序,涉及签入内容、时间、代码审查流程等。

There is no standard for the things you're asking about. Rather, there are conventions and these depend heavily on the size and maturity of the organization. If you're in a small organization, say a couple of programmers, then things will probably be somewhat informal with the individual developers doing coding, builds, and test.

In larger organizations, there may be a dedicated build engineer and process. This kind of organization will usually do a formal build on a regular basis, say once a day, using whatever source code is checked in. The process will also usually include BVT (Build Validation Tests) and perhaps some regression tests. Developers will check out the code from the repository, work on their own portion locally, then check it in.

In the largest organizations, like Microsoft or Google, they will have a completely dedicated group and full lab that will build on a more-or-less continual basis, making the results of each run available. These organizations have very formal processes and procedures in place about what gets checked in and when, what the code review processes are, etc.

絕版丫頭 2024-09-12 04:46:52

没有关于软件开发的指南,但一般来说,版本控制系统应该是构建系统的核心,即使您在一个项目中工作,而您是唯一的开发人员。即使在这种情况下,能够恢复版本并读取版本日志对于修复错误也是非常受欢迎的帮助。这不是版本控制系统的唯一功能,但这本身就证明了安装、配置和维护版本控制系统的合理性。

构建可以由每个开发人员在添加新代码时完成,也可以由“构建服务器”定期完成。最后一种方法需要更多设置,但有助于更快地发现构建错误。

There is no cookbook for working with software development, but in general the version control system should be the heart of your build system, even if you are working in a project where you are the only developer. Even in this case, being able to revert versions and read the version log is very welcome help in fixing bugs. This is not the only feature of a version control system, but this alone justifies installing, configuring and maintaining a version control system.

The build can be done either by each developer when adding new code, or periodically by a "build server". The last approach requires more setup, but helps finding out build errors sooner.

肥爪爪 2024-09-12 04:46:52

简短的回答是“这取决于”。

目前,我正在自己开发一个项目,所以我是构建/使用 VCS 的人。我知道在其他地方,你们的团队通过电子邮件一起致力于该项目。令人震惊。或者使用 VCS 的大型 (+5) 团队。

在这一点上,我强烈建议至少学习一些 VCS,Joel Spolsky 有一个很棒的 Mercurial 介绍性教程。 Bazaar(我个人的选择)是相似的,然后 Git 就相似性而言是第二接近的,但可能比其中任何一个都更受欢迎(至少是 ATM)。之后你就有了 SVN,相比之下它相当弱。

事实上,Joel 谈论解决了您的大部分问题 - 我建议您阅读 10 年他拥有的档案 - 这些都是非常有用的信息,其中大部分与您当前和近期的情况相关。

The short answer - "It depends".

Currently, I'm working on a project by myself, so I'm the one who builds/uses VCS. I know of other places that you have teams working on the project together by shudder email. Or big (+5) teams using VCS.

On that note, I highly recommend learning at least some VCS, and Joel Spolsky has a great introductory tutorial for Mercurial. Bazaar (my personal choice) is similar, and then Git is the next nearest in terms of similarity, but probably more popular than either (at least ATM). After that you have SVN which is pretty weak in comparison.

Actually, Joel talks about most of your questions - I'd recommend reading the 10 years of archives he has - it's all highly useful information, and most of it pertinent to your current and near-future situation.

嘿嘿嘿 2024-09-12 04:46:52

正确的编程是一件很深刻的事情,从经验中受益匪浅。结对编程就像运行多个意识处理器……一个人可能会忽略另一个人看到的东西,只要他们进行交流,就可以取得巨大的进步。

Proper programming is a deep thing that benefits greatly from experience. Pair-programming is like running multiple processors of awareness... one can overlook something seen by the other and so long as they are communicating it can result in great progress.

海的爱人是光 2024-09-12 04:46:52

首先,团队通过使用存储库(可以是专业版本控制,或者只是一堆被认为是“实时”目录的目录,但修订控制系统是事实上的标准)来工作。此外,项目管理策略的方式取决于您的工作方式(瀑布式、敏捷式等)。如果您以迭代方式工作,您将构建自我维持的组件/插件/模块/库,并执行单元测试,直到完成为止。作为一个团队,您在一个团队中工作,这意味着您不会同时在任何地方处理整个项目。相反,您将获得在项目领域内执行的任务。在某些情况下,您必须修复不属于您的代码,但这通常发生在发生奇怪的行为时。基本上,您正在对您开发的部件进行测试。

让我为您举例说明这一点。你在一个建筑工人团队中。建筑师提出建筑计划,工头查看建造的必要条件,然后雇用建造者。泥瓦匠砌墙,检查它们的强度并将它们很好地粘合起来。电工负责建筑物内的所有布线,以便电力能够流通。每个人都有自己的工作。有时,电工可能想与石匠讨论是否可以雕刻某些墙壁,但总是与工头一起讨论。

我希望这对您有帮助!

First of all, teams work by using repositories (which can be professional version control, or just a bunch of directories that is considered the 'live' one, however a revision control system is the de facto standard). Also, how the project is managed strategy depends on how you work (waterfall, agile, etc.). If you work in iterations, you build components/plugins/modules/libraries which are self-sustained, and you perform unit testing, until its signed off as finished. As a team, you work in a team which means you do don't work on the entire project everywhere at the same time. Instead, you get a task to perform inside a realm of the project. On some occasions you have to fix code that isn't yours, but that comes usually when a strange behavior occurs. Basically, you are doing the testing of the parts you develop.

Let me examplify this for you. You are inside a team of construction workers. The architect comes with a plan for a building, the foreman looks what the necessities are to construct and then hires the constructors. The mason does the walls, checks them for strength and glues them up nicely. The electrician does all the wiring inside the building so electricity can flow. Each man has their own job. Sometimes, the electrician might want to discuss with the mason if certain walls can be carved, but always in conjunction with the foreman.

I hope this is some help for you!

冷情 2024-09-12 04:46:52

通常,源代码控制系统包含源代码,但通常没有二进制文件。如果您想构建并运行它,您可以检查代码并在本地计算机上构建它。

有些地方每晚运行构建以确保一切正常。甚至可能有一些在服务器端运行的自动化测试。如果构建或其他任何事情失败,系统会自动通知某人。

Typically, the source control system contains the source code and usually does not have the binaries. If you want to build it and run it, you would check the code out and build it on your local machine.

Some places run nightly builds to make sure everything works. There may even be some automated tests that are ran server-side. If the build or anything else fails, someone is notified automatically.

独闯女儿国 2024-09-12 04:46:52

Eric Sink 的源代码控制 HOWTO http://www.ericsink.com/scm/source_control.html" rel="nofollow noreferrer">http://www.ericsink.com/scm/source_control.html 很好地介绍了使用源代码控制的方法。 ericsink.com/scm/source_control.html

在他的示例中,他使用了 SourceGear Vault,因为他编写了它,但这些方法可以应用于其他版本控制系统。

A good introduction to a method of using source control is Eric Sink's Source Control HOWTO http://www.ericsink.com/scm/source_control.html

In his examples he uses SourceGear Vault since he wrote it and all, but the methods can be applied to other version control systems.

泅渡 2024-09-12 04:46:52

这又是人们应该研究开源项目的一个很好的理由。

在大型开源项目(如 Chromium、Mozilla Firefox、MySQL、Popular Gnu Software)中工作的首席开发人员都是专业人士。他们拥有丰富的经验,这些项目是在数百名此类专业人士的想法的帮助下经过多年发展的。

其他人在答案中提到的所有内容(计划、版本控制系统、问题跟踪器、通知系统、构建系统、测试套件)都可以在这些开源项目中找到。

如果你真的想要亲身体验,我强烈建议你去体验一些流行的和有趣的东西。大型开源项目,然后从任何项目获取源代码(使用版本控制)并自行构建。

PS:我也是一名学生,参与开源项目是我一生中做过的最好的事情。相信我!你也会有同样的感觉。

This is again one good reason why one should look into Open Source projects.

The lead developers who work in big OpenSource projects (like Chromium , Mozilla Firefox, MySQL , Popular Gnu Software) are professionals. They have lot of experience and these projects have evolved over years with ideas from hundreds of such professionals.

Everything others mentioned in their answers (Plan, Version control system , Issue tracker , Notification system , Build system, Test suite, ) can be found in these OpenSource projects.

If you really want an hands on experience I strongly suggest you to go through some popular & big OpenSource projects and then get the Source from any project (using Version Control) and build it your self.

PS: I'm also a student and involving in OpenSource projects is the best thing I ever did in my life. Trust me! you'll also feel the same.

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