What are common java web development practices?

I would like to learn more about / a more effective understanding of common Java technology development practices of development teams that have at least two teams - web designers and web component developers. In particular, I am interested in such things as:

  • Assuming a code repository exists, do all teams check a local copy of all the code? If so, why does the web designer need / need access to the internal code, similarly, why does the web component developer need / need access to the interface?

  • How does each member of the team, regardless of the team, check their code - do they "deploy" the code to their local workstation, a separate instance in the development window, or an integrated block of developers?

  • How is integration and testing performed? For example, suppose a web designer creates a page of the "registration" form, and a web component developer creates internal code for processing and inserting data into db - how to integrate the interface and internal code and tested it?

Any additional information related to java-technologies of web development of development groups, which I did not specifically ask, but it matters, please share.

EDIT (NEXT): I appreciate the answers, they filled in most of the conceptual phenomena that I had about developing java sites. However, I have a few follow-up questions -

  • Testing, especially automated testing, is, of course, important parts of java website development; but what is a good “test”? For example, we can say that the java-back-end developer simply compiles the code that takes form data, validates it, and then inserts it into / updates the database. What would be a good test in this scenario? In addition, how can this be "automated"?

  • Can anyone state integration of continuity - i.e. Is their goal only to compile all the project code? Or will this help in automated testing? From what I understand, continuity integration servers control the repositories for commits, and after that they check the new modified code and compile the whole project; upon successful / unsuccessful compilation, the user is notified.

+7
java
source share
6 answers
  • We always check all the source code that we can handle. Source code for external libraries, backend systems and works. Reading backend code makes it easier for interface developers to understand what is going on. Third-party developers sometimes read the interface code to see how things are actually used. More code is good. Maven also supports automatic source code loading, which is great.

  • We use maven and I really recommend it in a team environment. We deploy locally, on command-line centralized test servers, and in regular receiving environments. The closer to the “home” you can check things out, the cheaper and more efficient.

  • We use selenium for a large number of tests, which allow us to use correctly deployed webapp for front-end testing. In addition, most integration tests that run parts of the stack run like normal junit tests in the maven profile.

+4
source share

How we do it in our team:

  • Yes. Each member checks the entire code, even if you are not working with all parts. You need to run the application on your local computer while you are working in order to quickly view the changes you have made. Front guys must run internal code to see front end effects.

  • During coding, each member runs the code on its machine. When it is checked, it is tested in general on a specially designated server.

  • Testing should be as automated as possible. Each team member writes a test code for his part of the code, and is also checked. You can use the continuous integration server to run these tests automatically. But the initial test does run on the local machine. If I check the code and then make changes to the base class, I will run the code and make sure that it works on my computer, updates all tests that need updating, and commits my changes. Automated tests run on the server to ensure that the various commits all work well.

I can’t say that this is the best of the best practices, but it’s a practice for our very small team of 4 developers.

+4
source share
  1. It depends on your project structure. Typically, java webapp projects adhere to the Maven project convention. If you have one project for the web interface and backend functions, all furniture teams need to check the sources, if the structure is divided into a web and backend project, each team can only check its own projects.
  2. If you are using Maven, this is natural for deploying the application. It is highly recommended that you use a CI (continuous integration) server such as Hudson . Antoher's very important aspect is to use an appropriate set of plugins (maven or hudson one), such as selenium tests or another web test.
  3. The integration test is performed by Maven / Hudson, of course, with a little help from plugins :). I mentioned Selenium , which may be Canoo WebTest or other testing frameworks that are sometimes suitable for the infrastructure or technology that you choose for development.

To summarize, follow the Maven path.

+3
source share

For the first question, you should usually see the source code for each line of the stack trace (this also means that you use the JDK for development, since Eclipse automatically attaches the src.zip file to the runtime libraries), even if it is outside your own area of ​​expertise .

So check out everything you can. It will help you someday - also coders, as a rule, write the best code and document it better if they know that the whole team will always see it.

For development and deployment. You can do whatever you want to develop and test your code, but any code that goes into production or outside the team must be created by the machine (this ensures reproducibility). For this we use Hudson, but this is just an accident. The latest senior team license for Atlassian Bamboo may mean that we use it too.

+2
source share

In our team ...

  • Our practice usually makes a new branch in the repository for new developments, and then combines them in the trunk to be tagged when they are ready for deployment in production. Therefore, we check the entire branch that we are working on. In addition, using SVN, a multiple encoder can work in the same file as SVN, does not block the file and allows you to merge them after, but this is a rare case. Automatic merging will not always work, and you will have to perform manual merging.

  • The first tests are performed locally, then deployed to the development environment, and then to the adoption environment. The code tested in DEV and the host environment is built by Luntbuild / ANT and delpoyed in our ApplicationServer using Jythons scripts. We never deploy or create manually outside the local environment. Whenever possible, we ask other people on the team to test them.

  • The Cactus API allows you to “warp” the jUnit test for servlets / locations / web applications. We are conducting a stress test with JMeter and Selenium (a good firefox plugin) for some other tests. You can also run coverage tools (like EMMA) that let you know what percentage of the code applies to your jUnit / Cactus tests.

+1
source share

Assuming a code repository exists, do all teams check a local copy of all the code? If so, why does the web designer need / need access to the internal code, similarly, why does the web component developer need / need access to the interface?

It depends on how big and how modular your project / assembly is. For large projects with a large code base, it is necessary to use a modular approach and binary dependencies. This will greatly improve local build time. If I am working on module A (which depends on B), I do not want to compile B during development cycles. It will slow me down, it is annoying. I prefer to use the binary dependency on B (and if I need to, I can still check B and compile it locally anyway).

How does each member of the team, regardless of the team, check their code - do they "deploy" the code to their local workstation, a separate instance in the development window, or an integrated block of developers?

Use special environments for each developer for web servers, application servers, database instances (see Use one database instance for each developer ). Team members should be able to restart, update whenever they want, without disturbing others (even if I advocate minimizing the time spent "in the container" during development, that is, preferring single tests in isolation). Thus, prefer a local workstation for anything that might need to be restarted: web server, application server, etc. Local deployment is also often easier. For a database, a remote database instance is generally good (and might be better, for example, if you have a large oracle server). Use a consolidated developer unit for a continuous integration process.

How is integration and testing performed? For example, suppose a web designer creates a page of the "registration" form, and a web component developer creates internal code for processing and inserting data into db - how to integrate the interface and internal code and tested?

First check them out separately. Mock / If necessary, mute the back-end. Then check everything. When performing integration or functional tests that interact with the database, it is good practice to always place the database in a known state before running the test (see. Good tuning does not require cleaning! ). DBUnit can help with this. Cactus is another good server-side testing tool, for example. integration testing. End-to-end testing to run aka functional tests, Selenium or WebDriver are good candidates. For acceptance testing (or BBD), I am currently studying Cucumber and I like it.

+1
source share

All Articles