本文介绍了如何审核一个Java EE项目?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经审计了$ C​​ $ C-建筑质量和可维护性(到底,以确保我们有什么,我们支付)基于JSF在Java EE Web项目/ CDI / EJB3.0 / JPA(只命名涉及的一些技术)的。

I've to audit the code-architecture quality and maintainability (in the end to be sure we have what we paid for) a Java EE web project based on JSF/CDI/EJB3.0/JPA (just to name some of the technologies involved).

这可能不是正确的地方要问,但是你怎么处理这样的任务?
基本上,我会继续从粗粒度从整体结构到java code细粒度,即。
它是更好地处理完全每层?
我应该花更多的时间在低级别的层?

This may not be the right place to ask but how do you deal with this kind of task?Basically, I would proceed from coarse-grained to fine-grained, i.e. from the whole architecture to the java code. Is it better to deal with each layer completely?Should I spend more time on the low-level layers?

你评估整个事情(构建,部署,测试)?

Do you assess the whole thing (build, deployment, test)?

推荐答案

在较低的物理/执行层面,我喜欢做的是采取Maven作为构建工具,然后配置丰富的行家报告,制作网站充满各种code指标。

At the lower physical/implementation level, what I like to do is adopt maven as a build tool, and then configure the extensive maven reporting, to produce a website full of various code metrics.


  • 对于初学者来说就有它可以在$报告C $ C标准到指定的标准,编码标准的一致性有很多明显的好处,大部分项目将采用简单的pre-配置的标准例如,一个太阳或Apache。

  • 列出了潜在的编程错误

  • 还有的code覆盖报告一个选择,我使用中的Cobertura。其中部分单元测试所覆盖的申请行这些节目线。 Maven的支持在构建生命周期的单元测试,运行它们作为构建的一部分。这几次救了我。

  • PMD插件识别复制code,突出地区可能需要重构。

  • For starters there is the maven checkstyle plugin which can report on code conformance to a specified standard, consistency in coding standards has many obvious benefits, most projects would simply adopt one of the pre-configured standards e.g. sun or apache.
  • The findbugs plugin lists potential programming errors
  • There are a choice of code coverage reports, I've used cobertura. These show line for line in an application which parts are covered by unit tests. Maven supports unit tests in the build life-cycle, running them as part of the build. This has saved me a few times.
  • The PMD plugin identifies duplicated code, and highlights areas that may need refactoring.

在这个设置,并成为构建正常周期的一部分,它主要负责照顾本身,你会不会担心这样做大型双年度审计/追赶。

Once this is setup and becomes part of the normal build cycle, it basically takes care of itself, and you won't have to worry about doing large bi-annual audits/catch-up.

许多报告具有比N%Checkstyle的错误更多的,如​​果违反了可被配置成构建失败阈值限制,即,导致生成失败。

Many of the reports have threshold limits that can be configured to fail the build if breached, i.e. more than n% checkstyle errors, cause a build failure.

的Maven还促进了模块化的方法来构建应用程序,这将导致更小,更易于理解和可重复使用的模块,以及关注点分离,即对于presentation和持久层单独的模块。该Maven提供的主要好处是管理模块之间的相互依存关系。

Maven also promotes a modular approach to building applications, this results in smaller more understandable and re-usable modules, as well as separation of concerns, i.e. separate modules for presentation and persistence layers. The main benefit that maven provides is managing the inter-dependencies between the modules.

这不会帮助你了在更高层次的架构层的,所以一个互补的做法将被要求支付该维度。

This doesn't help you very much at the higher-level architecture layers though, so a complementary approach will be required to cover that dimension.

请参阅此链接结果一些样本报告
 

See some sample reports at this link
http://maven.apache.org/plugins/maven-dependency-plugin/project-reports.html

这篇关于如何审核一个Java EE项目?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-25 11:17