J2EE Development Best Practices: Improving Code Quality

Similar documents
Technical Metrics for OO Systems

Oracle Developer Day

Effective Modular Design

Borland Optimizeit Enterprise Suite 6

Metrics and OO. SE 3S03 - Tutorial 12. Alicia Marinache. Week of Apr 04, Department of Computer Science McMaster University

J Optimizer 1.0 User Guide

Where Do We Go From Here? Why Many IT Staff are Living in the Past

Visualizing Software Metrics for increased Refactoring

CHAPTER 4 HEURISTICS BASED ON OBJECT ORIENTED METRICS

Kostis Kapelonis Athens Greece, March 2010

Using Metrics To Manage Software Risks. 1. Introduction 2. Software Metrics 3. Case Study: Measuring Maintainability 4. Metrics and Quality

Oracle JDeveloper/Oracle ADF 11g Production Project Experience

Oracle Fusion Middleware 11g: Build Applications with ADF Accel

<Insert Picture Here> Oracle Application Framework (OAF): Architecture, Personalization, and Extensibility in Oracle E-Business Suite Release 12

Jackson Marusarz Software Technical Consulting Engineer

Object Oriented Metrics. Impact on Software Quality

A- Core Java Audience Prerequisites Approach Objectives 1. Introduction

P17 System Testing Monday, September 24, 2007

Important Points to Note

Measuring the quality of UML Designs

Zing Vision. Answering your toughest production Java performance questions

Enterprise Architect. User Guide Series. Profiling

Quantify the project. Better Estimates. Resolve Software crises

Enabling Application Lifecycle Development in JDeveloper

Enterprise Architect. User Guide Series. Profiling. Author: Sparx Systems. Date: 10/05/2018. Version: 1.0 CREATED WITH

NightStar. NightView Source Level Debugger. Real-Time Linux Debugging and Analysis Tools BROCHURE

Session id: The Self-Managing Database: Guided Application and SQL Tuning

EVALUATING IMPACT OF INHERITANCE ON OBJECT ORIENTED SOFTWARE METRICS

Essential (free) Tools for DBA!

Investigation of Metrics for Object-Oriented Design Logical Stability

Research Article ISSN:

Risk-based Object Oriented Testing

Toad for Oracle Suite 2017 Functional Matrix

Chapter 2. Operating-System Structures

Building Mobile Applications. F. Ricci 2010/2011

Java SE 7 Programming

1 Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Memory & Thread Debugger

Gauging ADF Application Performance: Instrumenting Your Code

Effects of Dependency Injection on Maintainability. Kate Razina

Peter Moskovits Principal Product Manager Oracle Corporation. Sue Vickers Group Manager Oracle Corporation

Task Flow Recorder for CICS

Empirical Evaluation and Critical Review of Complexity Metrics for Software Components

Oracle Middleware 12c: Build Rich Client Applications with ADF Ed 1 LVC

Build and Deploy Stored Procedures with IBM Data Studio

Profiling & Optimization

HPC Tools on Windows. Christian Terboven Center for Computing and Communication RWTH Aachen University.

PERFVIEW..NET runtime performance and ETW event analysis tool

Using Static Code Analysis to Find Bugs Before They Become Failures

DNWSH - Version: 2.3..NET Performance and Debugging Workshop

Intel Parallel Studio 2011

Systems software design. Software build configurations; Debugging, profiling & Quality Assurance tools

Memory Allocation. Static Allocation. Dynamic Allocation. Dynamic Storage Allocation. CS 414: Operating Systems Spring 2008

Intro to Flex Debugging and Profiling

Oracle Database 10g The Self-Managing Database

ProdDiagNode - Version: 1. Production Diagnostics for Node Applications

Application of Object Oriented Metrics to Java and C Sharp: Comparative Study

Truffle A language implementation framework

Fiji VM Safety Critical Java

A Study of Software Metrics

profiling Node.js applications

This assignment requires that you complete the following tasks (in no particular order).

An Introduction to Software Engineering. David Greenstein Monta Vista High School

Core Java - SCJP. Q2Technologies, Rajajinagar. Course content

Using Automated Network Management at Fiserv. June 2012

FREQUENTLY ASKED QUESTIONS

CHAPTER 2: SYSTEM STRUCTURES. By I-Chen Lin Textbook: Operating System Concepts 9th Ed.

Chapter 2: Operating-System Structures

IDE for medical device software development. Hyun-Do Lee, Field Application Engineer

This presentation is for informational purposes only and may not be incorporated into a contract or agreement.

ITERATIVE DEVELOPMENT: THE USE OF J2EE BEST PRACTICES

Java SE 7 Programming

Overview. Principal Product Manager Oracle JDeveloper & Oracle ADF

Oracle Fusion Middleware 11g: Build Applications with ADF I

Profiling & Optimization

Advanced Debugging and the Address Sanitizer

Notes of the course - Advanced Programming. Barbara Russo

An Introduction to Runtime Analysis with Rational PurifyPlus

Oracle Database: Program with PL/SQL

Using Intel VTune Amplifier XE and Inspector XE in.net environment

Oracle Developer Day

E-BOOK // ORACLE 10G SQL EBOOK EBOOK

Quickly Pinpoint and Resolve Problems in Windows /.NET Applications TECHNICAL WHITE PAPER

Chapter 2: Operating-System Structures. Operating System Concepts 9 th Edit9on

Oracle ADF: The technology behind project fusion. Lynn Munsinger Principal Product Manager Application Development Tools Oracle Corporation

Language Translation. Compilation vs. interpretation. Compilation diagram. Step 1: compile. Step 2: run. compiler. Compiled program. program.

Oracle and Toad Course Descriptions Instructor: Dan Hotka

Oracle Developer Studio 12.6

ORACLE ENTERPRISE MANAGER 10g ORACLE DIAGNOSTICS PACK FOR NON-ORACLE MIDDLEWARE

Object Oriented Measurement

Tutorial: Analyzing MPI Applications. Intel Trace Analyzer and Collector Intel VTune Amplifier XE

WHITE PAPER: ENTERPRISE AVAILABILITY. Introduction to Adaptive Instrumentation with Symantec Indepth for J2EE Application Performance Management

Oracle Database 12c Performance Management and Tuning

PROGRAMMING IN VISUAL BASIC WITH MICROSOFT VISUAL STUDIO Course: 10550A; Duration: 5 Days; Instructor-led

Java performance - not so scary after all

Improving the Productivity of Scalable Application Development with TotalView May 18th, 2010

1 Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Software Design & Evolution. Lecture 04. You cannot control what you cannot measure. Metrics & Problem Detection. Michele Lanza

WHITE PAPER Application Performance Management. The Case for Adaptive Instrumentation in J2EE Environments

25. DECUS Symposium THE Application Development Environment for OpenVMS

Transcription:

Session id: 40232 J2EE Development Best Practices: Improving Code Quality Stuart Malkin Senior Product Manager Oracle Corporation

Agenda Why analyze and optimize code? Static Analysis Dynamic Analysis SCM, Building, Testing

Agenda Why analyze and optimize code? Static Analysis Dynamic Analysis SCM, Building, Testing

Why Analyze and Optimize? Catch common problems before entering code base. Extra effort saves time and project cost later Instill best practices/standards across teams Address code quality and performance throughout the entire development cycle

Benefits of Using Oracle JDeveloper 10g for Tuning Integrated features means no tool-swapping Increase productivity Easy to incorporate static, dynamic analysis and tuning as part of development Build better applications faster Optimized for real applications We use JDeveloper to tune JDeveloper

Agenda Why analyze and optimize code? Static Analysis Dynamic Analysis SCM, Building, Testing

Static Analysis Auditing Code Static qualitative analysis of source files Compliance with a set of rules Suggested fixes Metrics Static quantitative analysis of attributes of source files Chidamber-Kemmerer metrics Generally measure code complexity

Audit Coding Conventions http://java.sun.com/docs/codeconv/html/codeco nvtoc.doc.html Java Doc Rules that verify completeness and correctness of doc comments J2EE specification Your own standards!

Metrics Chidamber and Kemerer Metrics Cyclomatic Complexity (CC) Source Lines of Code (SLOC) Weighted Methods per Class (WMC) Response for Class (RFC) Lack of Cohesion of Methods (LCOM) Coupling Between Objects (CBO) Depth of Inheritance Tree (DIT) Number of Children (NOC) Other Metrics Number of Statements (NOS) Executable Statements (EXEC) Comment Percentage (CP) Number of Audit Violations (NAV)

D E M O N S T R A T I O N Audit and Metrics

Agenda Why analyze and optimize code? Static Analysis Dynamic Analysis SCM, Building, Testing

Dynamic Analysis Performance Tuning Needs to run application in VM Profilers Debuggers Code Advisors Investigate use case to provide context sensitive results.

Performance Network, file Input/Output (I/O), database access Memory footprint CPU usage

When to Performance Tune Address performance throughout the entire development cycle Not too early, not too late Tune iteratively 80/20 principle Code Test Tune

How to Measure Performance Stopwatch System.currentTimeMillis() Benchmarks Profilers

What to measure? Time Elapsed time CPU time Memory Usage Garbage Collection VM events Class loading, Class resolving Application specific events

Profilers Local, remote, and distributed profiling Execution time (CPU) Events Memory usage

Execution Profiler Where is my program spending time? Takes samples of execution stack at customizable intervals Shows: Time spent in the method Percentage of samples when method is on top of the execution stack Percentage of samples when method is anywhere on the execution stack Calls to other methods and calls from other methods

Execution Profiler Measure time spent in methods within execution stack

Memory Profiler How is memory being utilized? Takes snapshot of Java heap at customizable intervals Shows: Number of object instances in heap and amount of memory consumed by the objects Difference between number of instances created and freed for each time sample Origins of object allocation (drill-down) Watch memory footprint and detect memory leaks

Memory Profiler

Event Profiler How often does an event occur and how long does it last? Measures the beginning, end, and duration of events Shows: VM events (loading classes, resolving classes, garbage collecting, etc) BC4J events (loading meta-data, connecting to database, executing queries, etc) Custom events you instrument using a simple API

Event Profiler VM Events Class loading Class resolving Garbage Collection Custom Events Execute_Query JDBC_Create_ Statement

Debugger Super-fast debugging HotSwap recompilation with popframe Many performance-related features Locate memory leaks View loaded classes and number of instances Examine Java heap usage Find references to object instances in the heap Force garbage collection while debugging Automatically detect deadlocks Examine status of monitors

UI Debugger Examine the GUI structure and the event sequences Examine application component hierarchy Display component Info in Watches Window Trace Events generated by components Discover listeners on components

UI Debugger

Code Advisor--CodeCoach Analyzes code at runtime Identifies (and fixes) common coding pitfalls Modifier and scope definition Unused variables and fields Object sizing Dead code Inefficient instanceof usage Immutable objects with constant parameters

CodeCoach Fix issues Scope definition Sizing suggestions Memory suggestions CodeCoach identifies and fixes common coding pitfalls

CodeCoach customization

D E M O N S T R A T I O N Dynamic Analysis and Tuning

Agenda Why analyze and optimize code? Static Analysis Dynamic Analysis SCM, Building, Testing

SCM Software Configuration Management (SCM) Contains multiple versions of source code Sometimes called a Version Control System (VCS) Allows Developers to work in parallel Many Commercial and Open Source Tools CVS, Clear Case, Visual Source Safe Oracle SCM, and many others ( too many to list )

Building Many ways to build Shell scripts Ant GNU make Perl scripts All end up invoking a Java compiler As a Java developer, you may like Ant

Testing with JUnit JUnit is an Open Source white box testing framework and test harness Basic building blocks are test cases Test cases may use test fixtures Reusable logic to be shared among test cases Test cases may be combined into test suites Test runners launch test suites and report the results in various ways (GUI/Console/HTML)

D E M O N S T R A T I O N Building and Testing

Next Steps. Recommended sessions Using Oracle JDeveloper and Oracle Application Server 10g in Tandem (session 40253) Setting Up Your Java Development Environment on Linux (session 40257) Recommended demos and/or hands-on labs Develop J2EE applications using the new J2EE framework, Oracle Application Development Framework (Oracle ADF) Design, develop, tune, and debug your SQL and PL/SQL applications in Oracle JDeveloper. See Your Business in Our Software Visit the DEMOgrounds and talk 1-on-1 with experts. Relevant web sites to visit for more information http://otn.oracle.com/products/jdev

otn.oracle.com Join Over 3,000,000 Developers! Free Technical Advice Free Software Downloads http://otn.oracle.com

FREE Develop your career with Oracle s experts Web services, Forms Upgrade to the Web, TopLink, Business Intelligence, Integration, J2EE, Linux Connect with your peers Sign up at http://otn.oracle.com/events/otnworkshop

Q U E S T I O N S A N S W E R S

Reminder please complete the OracleWorld online session survey Thank you.