Development Environment and Tools for Java. Brian Hughes IBM



Similar documents
Programming Against Hybrid Databases with Java Handling SQL and NoSQL. Brian Hughes IBM

What new with Informix Software as a Service and Bluemix? Brian Hughes IBM

Practical Performance Understanding the Performance of Your Application

Useful Business Analytics SQL operators and more Ajaykumar Gupte IBM

Leveraging WebSphere Commerce for Search Engine Optimization (SEO)

Name: Srinivasan Govindaraj Title: Big Data Predictive Analytics

Minimizing code defects to improve software quality and lower development costs.

Rational Asset Manager 7.2 Editions and Licensing

IBM Software Group. SW5706 JVM Tools IBM Corporation 4.0. This presentation will act as an introduction to JVM tools.

IBM WebSphere Application Server Communications Enabled Applications

Tuning WebSphere Application Server ND 7.0. Royal Cyber Inc.

How To Use Java On An Ipa (Jspa) With A Microsoft Powerbook (Jempa) With An Ipad And A Microos 2.5 (Microos)

An Oracle White Paper September Advanced Java Diagnostics and Monitoring Without Performance Overhead

Ten questions to ask when evaluating contract management solutions

IBM Business Monitor. BPEL process monitoring

WebSphere Business Monitor

How To Improve Performance On An Asa 9.4 Web Application Server (For Advanced Users)

TeamCity A Professional Solution for Delivering Quality Software, on Time

Business Process Management IBM Business Process Manager V7.5

Web servers and WebSphere Portal

WebSphere Business Monitor

WebSphere Business Monitor

Tivoli Endpoint Manager for Security and Compliance Analytics. Setup Guide

IBM RATIONAL PERFORMANCE TESTER

How To Choose A Business Continuity Solution

Reading multi-temperature data with Cúram SPMP Analytics

WebSphere Business Monitor

Industry Models and Information Server

Gain a competitive edge through optimized B2B file transfer

Agile enterprise content management and the IBM Information Agenda.

Business Process Management IBM Business Process Manager V7.5

THE BUSY DEVELOPER'S GUIDE TO JVM TROUBLESHOOTING

Big Data Analytics with IBM Cognos BI Dynamic Query IBM Redbooks Solution Guide

WebSphere Commerce V7 Feature Pack 2

Monitoring and Diagnosing Production Applications Using Oracle Application Diagnostics for Java. An Oracle White Paper December 2007

Java Monitoring. Stuff You Can Get For Free (And Stuff You Can t) Paul Jasek Sales Engineer

Service Product: IBM Cloud Automated Modular Management (AMM) for SAP HANA One

Tivoli Endpoint Manager for Security and Compliance Analytics

Instrumentation Software Profiling

Memory-to-memory session replication

Hadoop Basics with InfoSphere BigInsights

WebSphere Business Monitor

Content. Development Tools 2(63)

Eclipse Visualization and Performance Monitoring

SINGLE SIGNON FUNCTIONALITY IN HATS USING MICROSOFT SHAREPOINT PORTAL

What s Cool in the SAP JVM (CON3243)

Windows 2000 / NT 4.0 / 95 / 98, MS-DOS, Suse Operating Systems

IBM Software Hadoop Fundamentals

Web application security: automated scanning versus manual penetration testing.

IBM Tivoli Provisioning Manager V 7.1

Converting Java EE Applications into OSGi Applications

Model-driven development solutions To support your business objectives. IBM Rational Rhapsody edition comparison matrix

Profiling and Testing with Test and Performance Tools Platform (TPTP)

IBM Innovate AppScan: Introducin g Security, a first. Bobby Walters Consultant, ATSC bwalters@atsc.com Application Security & Compliance

Java Troubleshooting and Performance

IBM WebSphere Application Server

Configuring and Integrating JMX

Rational Reporting. Module 2: IBM Rational Insight Data Warehouse

Focus on the business, not the business of data warehousing!

Mission-Critical Java. An Oracle White Paper Updated October 2008

Leveraging Rational Team Concert's build capabilities for Continuous Integration

IBM Tivoli Network Manager V3.9

Virtualization and the U2 Databases

The IBM Archive Cloud Project: Compliant Archiving into the Cloud

DataPower z/os crypto integration

Tivoli Automation for Proactive Integrated Service Management

IBM Software Information Management. Scaling strategies for mission-critical discovery and navigation applications

IBM WebSphere Partner Gateway V6.2.1 Advanced and Enterprise Editions

SW5706 Application deployment problems

IBM Tivoli Composite Application Manager for WebSphere

Improving customer satisfaction and operational efficiencies with a proven portal solution.

IBM Tivoli Service Request Manager 7.1

A proven 5-step framework for managing supplier performance

IBM PowerSC Technical Overview IBM Redbooks Solution Guide

BEAJRockit Mission Control. Using JRockit Mission Control in the Eclipse IDE

WebSphere Application Server V6: Diagnostic Data. It includes information about the following: JVM logs (SystemOut and SystemErr)

IBM TRIRIGA Anywhere Version 10 Release 4. Installing a development environment

SmartCloud Monitoring - Capacity Planning ROI Case Study

tools that make every developer a quality expert

<Insert Picture Here> What's New in NetBeans IDE 7.2

WEBLOGIC SERVER MANAGEMENT PACK ENTERPRISE EDITION

CSCI E 98: Managed Environments for the Execution of Programs

Linux. Managing security compliance

IBM Security QRadar Version (MR1) Checking the Integrity of Event and Flow Logs Technical Note

Monitoring, Tracing, Debugging (Under Construction)

Patch Management for Red Hat Enterprise Linux. User s Guide

Oracle JRockit Mission Control Overview

UML for the C programming language.

Installing and Configuring DB2 10, WebSphere Application Server v8 & Maximo Asset Management

IBM FlashSystem. SNMP Guide

IBM WebSphere Application Server

Continuous Integration and Bamboo. Ryan Cutter CSCI Spring Semester

WebSphere Commerce V7.0

Oracle WebLogic Thread Pool Tuning

How To Integrate Pricing Into A Websphere Commerce Pricing Integration

Enhanced Diagnostics Improve Performance, Configurability, and Usability

Java VM monitoring and the Health Center API. William Smith

Transcription:

Development Environment and Tools for Java Brian Hughes IBM 1

Acknowledgements and Disclaimers Availability. References in this presentation to IBM products, programs, or services do not imply that they will be available in all countries in which IBM operates. The workshops, sessions and materials have been prepared by IBM or the session speakers and reflect their own views. They are provided for informational purposes only, and are neither intended to, nor shall have the effect of being, legal or other guidance or advice to any participant. While efforts were made to verify the completeness and accuracy of the information contained in this presentation, it is provided AS-IS without warranty of any kind, express or implied. IBM shall not be responsible for any damages arising out of the use of, or otherwise related to, this presentation or any other materials. Nothing contained in this presentation is intended to, nor shall have the effect of, creating any warranties or representations from IBM or its suppliers or licensors, or altering the terms and conditions of the applicable license agreement governing the use of IBM software. All customer examples described are presented as illustrations of how those customers have used IBM products and the results they may have achieved. Actual environmental costs and performance characteristics may vary by customer. Nothing contained in these materials is intended to, nor shall have the effect of, stating or implying that any activities undertaken by you will result in any specific sales, revenue growth or other results. Copyright IBM Corporation 2015. All rights reserved. U.S. Government Users Restricted Rights Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. IBM, the IBM logo, ibm.com are trademarks or registered trademarks of International Business Machines Corporation in the United States, other countries, or both. If these and other IBM trademarked terms are marked on their first occurrence in this information with a trademark symbol ( or TM), these symbols indicate U.S. registered or common law trademarks owned by IBM at the time this information was published. Such trademarks may also be registered or common law trademarks in other countries. A current list of IBM trademarks is available on the Web at Copyright and trademark information at www.ibm.com/legal/copytrade.shtml Other company, product, or service names may be trademarks or service marks of others. 2

Agenda Importance of Tooling Selection Criteria Integrated Development Environments Eclipse, IntelliJ IDEA Source Control Systems RTC, git Static Analysis/Metrics FindBugs, CodePro Analytix, EclEmma Unit Testing JUnit, TestNG Runtime Analysis IBM Java Health Center, IBM Heap Analyzer, SLF4J 3

Importance of Tooling Tooling can make order of magnitude difference in product build time and quality Tooling that works together can greatly speed up productivity Good tools encourage better processes, styles, best practice use, and streamlined development 4

Selection Criteria Tools must be mature/popular Nothing that s not backed by documentation, examples, groups and stackoverflow topics Nothing obscure that nobody has heard of and may not be around next month Tools that are actually used These are selected as they are actually used in development of software Applicable for projects both small and large You won t need million line enterprise projects to find value in the tooling shown in this session 5

Integrated Development Environments Foundation for other tooling Highly extensible IDE s allow easy integration and execution of other tools Two popular IDE s Eclipse IntelliJ IDEA Eclipse used more at IBM Many IBM tools built as extensions to Eclipse Eclipse marketplace has made finding extensions and tools much easier IntelliJ Has more analysis tools built in (analyzer, code coverage) Analysis caught different (minor) issues than other tools 6

Source Control Systems From small personal tooling to large million line projects, storing work in source control systems is essential Peace of mind work is backed up Small/pet projects can suddenly become products or important components of your dev process People come and go, where is their work saved? 7

Source Control Systems (cont) GIT and RTC are commonly used SCM s GIT used for open source projects Strong support for non-linear development Easy to do distributed development RTC used for internal projects New projects, products, tooling Both have strong Eclipse extensibility support Covers up some complexity of GIT Makes both SCM s easy to use Branching, merging, history all integrated into the IDE 8

Static Analysis/Metrics Static analysis is the quickest way (after unit testing and code reviews) to find problems in code of all sizes Built into IDE s it s made easy to run Running static analysis can be made and easy addition to any development process Boxed into IDE s Plugin to Jenkins or other build management systems 9

FindBugs Found in Eclipse Marketplace http://findbugs.sourceforge.net/ Performs static code analysis on Java ByteCode, not source code Categorizes errors into 4 ranks and 2 levels of confidence 10

FindBugs (cont) 11

EclEmma Code coverage tool for Eclipse Based on/uses JaCoCo which is a code coverage tool for Java Found in the Eclipse marketplace Has updated support for Java 8 Lambda expression support Has coverage counters for: Instructions Branches Lines (with debug information) 12

EclEmma 13

CodePro AnalytiX Suite of Static analysis tools and test case generation Static analysis from source code auditing rather than bytecode (different from FindBugs) 14

CodePro AnalytiX Auditing checks code against audit rules Can catch critical issues Finds lots of performance related or poor code styling issues 15

CodePro AnalytiX Metrics gives you a view into several aspects of your code Size, size per file/class/method Abstractness Various levels of complexity 16

CodePro AnalytiX 17

CodePro AnalytiX Dependency Graphs Shows dependences for external libraries and between packages Can get really messy Really good way to visualize circular dependencies among packages and to see dependencies 18

CodePro AnalytiX What can you make of this? 19

CodePro AnalytiX Drilling down allows you to start to view the issues with your architecture 20

Unit Testing Key process for test driven development TDD not just for large projects or products Useful for validating core functionality The higher the dependence on a library or class, the greater amount of Unit testing you want protecting it Code speaks louder than words Descriptions of a function can become outdated, a test that is always ran, is always up to date! 21

JUnit Defacto unit test framework for Java Comes with Eclipse IDE Simple to get started Allows calls to setup/cleanup methods to run before/after tests and testcases 22

JUnit (cont) package com.ibm.utm.core.tests; import org.junit.after; import org.junit.before; import org.junit.test; import static org.junit.assert.*; public class IIUGTtest { @Before public void startup() { System.out.println("code to run before running a tests goes here!"); } @After public void cleanup() { System.out.println("code to run after running a tests goes here!"); } @Test public void test1() { System.out.println("running test1"); assertequals(1, 2); } @Test public void test2() { System.out.println("running test2"); assertequals(1, 1); } } 23

TestNG Increasingly popular unit test framework for Java Just as easy as JUnit to get started Has more features and flexibility for managing larger number of unit tests Method grouping Test dependency Parameterized tests Source: http://www.mkyong.com/unittest/junit-4-vs-testng-comparison/ 24

TestNG (cont) package com.ibm.utm.core.tests; import org.testng.annotations.aftertest; import org.testng.annotations.beforetest; import org.testng.annotations.test; public class IIUGTestNG { @BeforeTest public void startup() { System.out.println("code to run before running a tests goes here!"); } @AfterTest public void cleanup() { System.out.println("code to run after running a tests goes here!"); } @Test public void test1() { System.out.println("running test1"); assertequals(1, 2); } @Test public void test2() { System.out.println("running test2"); assertequals(1, 1); } } 25

Runtime Analysis Once application is deployed, how do you track/resolve problems Services vs applications Services run 24x4 while applications run for a shorter time Require different approaches to tracking down issues that arise 26

Runtime Analysis - Logging Logging is an art Too much logging slows down systems, fills up disks, harder to search for problems Too little logging leaves you wondering what actually happened Logging can be as a simple as prints to the console or as complex as logging frameworks reporting to databases 27

Runtime Analysis SLF4J SLF4J Simple Logging Facade for Java commonly used logging framework for Java Very easy to setup and use Requires 2 JAR files Can swap out binded loggers Just put one in your CLASSPATH Easy to switch between loggers or create your own! Using SLF4J with Logback allows deep customization of logging using XML with zero code changes 28

Runtime Analysis SLF4J 29

Runtime Analysis IBM Health Center for Java Helpful diagnosing issues running the IBM version of Java Oracle Java has its own set of analysis tooling (JConsole) Easily installable Eclipse plugin from the Eclipse Marketplace Uses a health center agent to monitor the application and communicate with the Health Center Uses ~ 1% CPU overhead for monitoring Can collect memory, CPU, I/O, locking, loaded classes, threads Provides profiling capabilities 30

Runtime Analysis IBM Health Center for Java 31

Runtime Analysis IBM Health Center for Java 32

Runtime Analysis IBM Health Center for Java 33

Thread Analysis Useful when you wonder how many threads are running, is my program deadlocked, what is it doing right now? You can trigger thread dumps in Java by issuing a kill QUIT (kill -3) command against the Java PID Sometimes it s just as easy to manually view the javacore files 34

Thread Analysis IBM Thread and Monitor Dump Analyzer Free tool from IBM to analyze thread dumps Reads in javacore files Parses files to produce some information aggregation for you Useful when you need aggregation or summary of many threads 35

Heap Analysis Typically triggered by out of memory issues, heap dumps and subsequent analysis can be both crucial and complicated in finding and fixing problems with your application Memory leaks in java are typically collections not being emptied, or resources not being closed Sometimes you need to trigger you own heap dump Adding Xdump options to JVM can allow auto-trigger of heap dumps when a SIGQUIT is issued http://www- 01.ibm.com/support/docview.wss?uid=swg21242497 36

IBM HeapAnlayzer Handy tool for processing and analyzing Java heap dumps Attempts to automatically detect memory leaks by looking for the largest objects in the heap Displays breakdown of objects and what they contain Makes it easy to track down memory leaks due to collections holding too many objects and finding very large objects 37

IBM HeapAnalyzer Easy to read tree breakdown of the objects found in the Java heap Does not get you all the way In this example, which list from the map went awry? 38

Links CodePro Analytix https://developers.google.com/java-dev-tools/codepro/doc/ FindBugs http://findbugs.sourceforge.net/ EclEmma code coverage http://www.eclemma.org/ http://www.sonarqube.org/ SLF4J http://www.slf4j.org LogBack http://logback.qos.ch/ IBM Thread and Monitor Dump Analyzer https://www.ibm.com/developerworks/community/groups/service/html/communityview?communityuuid= 2245aa39-fa5c-4475-b891-14c205f7333c IBM HeapAnalyzer https://www.ibm.com/developerworks/community/groups/service/html/communityview?communityuuid= 4544bafe-c7a2-455f-9d43-eb866ea60091 IBM Health Center http://www.ibm.com/developerworks/java/jdk/tools/healthcenter/ 39

Questions? 40