- SourceForge
Download
Report
Transcript - SourceForge
Mauricio Rodriguez
ODS Tools – Fannie Mae
Copyright © 2010 Accenture All Rights Reserved. Accenture, its logo, and High Performance Delivered are trademarks of Accenture.
SLF4J “Simple Logging Cascade for Java”
• Simple facade for logging systems allowing the end-user to
plug-in the desired logging system at deployment time.
• Supports : slf4j + log4j
slf4j + java.util.logging
slf4j + logback
• Migration could be completed in a matter of minutes by
replacing one jar file with another.
• Use the API that works best with your development
Copyright © 2012 Accenture All Rights Reserved.
2
Installation Guide
• Download the JAR files from the official SL4J page
(http://www.slf4j.org/download.html) and add the necessary
JAR file to your project.
• If you are using Spring Framework, then add the
dependency to the POM file of your project:
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<version>1.0.4</version>
</dependency>
If you wish to use log4j instead of logback just change the
articaftId.
Copyright © 2010 Accenture All Rights Reserved.
3
PMD
• PMD scans Java source code and looks for potential
problems
• Possible bugs - empty try/catch/finally/switch statements
• Dead code - unused local variables, parameters and private
methods
• Suboptimal code - wasteful String/StringBuffer usage
• Overcomplicated expressions - unnecessary if statements,
for loops that could be while loops
• Duplicate code - copied/pasted code means copied/pasted
bugs
Copyright © 2010 Accenture All Rights Reserved.
4
PMD
• Works with JDeveloper, Eclipse, JEdit, JBuilder, BlueJ,
CodeGuide, NetBeans/Sun Java Studio Enterprise/Creator,
IntelliJ IDEA, TextPad, Maven, Ant, Gel, JCreator, and
Emacs.
• To install on Eclipse go to "Help"->"Software Updates">"Find and Install“. Click "Next", then click "New remote site“
> Enter "PMD" into the Name field and
"http://pmd.sf.net/eclipse" into the URL field.
Copyright © 2010 Accenture All Rights Reserved.
5
J-Unit Eclipse Plugin
• Simple Java testing framework to write tests for you Java
application
• Used to write and run repeatable automated tests
• Eclipse supports creating test cases and running test suites,
so it is easy to use for your Java applications.
• Assertions for testing expected results: assertEquals(),
assertFalse(), assertArrayEquals(), assertNotNull(),
assertTrue().
• Graphical and textual test runners
Copyright © 2010 Accenture All Rights Reserved.
6
J-Unit Eclipse Plugin
Select a java file
From context menu (right
click)
[New]
[Other]
Copyright © 2010 Accenture All Rights Reserved.
7
Jenkins
• Application that monitors executions of repeated jobs, such
as building a software project or jobs run.
• Helps on Building/testing software projects continuously
• Can execute Apache Ant and Apache Maven based projects
• Plugins are available for integrating Jenkins with most
version control systems and bug databases.
Copyright © 2010 Accenture All Rights Reserved.
8
Jenkins – Plugins by topic
• Source code management : CVS plugin, GIT plugin,
Subversion plugin, Repo plugin.
• Build Triggers: Maven Dependency Update trigger, URL
change trigger , BuildResultTrigger Plugin.
• Build Tools: Ant plugin, Grails plugin, JBoss managament
plugin, Ruby plugin.
• BuildReports : CheckStyle plugin, PMD plugin, FindBugs
plugin.
Copyright © 2010 Accenture All Rights Reserved.
9
CheckStyle
• Development tool to help programmers write Java code that
adheres to a coding standard.
• Automates the process of checking Java code
• Highly configurable and can be made to support almost any
coding standard.
• It checks code layout issues, find class design problems,
duplicate code, or bug patterns.
• Plugins available to work with Eclipse, Netbeans, Maven,
Copyright © 2010 Accenture All Rights Reserved.
10