Upload
lola-cantrill
View
215
Download
0
Embed Size (px)
Citation preview
®
IBM Software Group
© IBM Corporation
Improve Productivity in Code-Centric, Model-Driven and Rapid Application Development
IBM Software Group
2
Objectives
After completing this session, you should be able to: Understand where quality fits in the IBM Software Development Platform
Understand why developer testing is important
Identify the challenges that developers face in creating quality code
Identify the benefit of using IBM Rational Software Architect to:
Validate the code for correctness and compliance
Ensure reliability and usability
Identify optimum performance
IBM Software Group
3
The IBM Software Development PlatformWhat’s new & enhanced: Simplified solutions
CustomerExtensions
3rd PartyISV Tools
Rational Software Architect
Rational Web/App Developer
Rational Functional & Manual
Tester
Rational Performance
Tester
Tivoli Configuration
Manager
Rational RequisitePro
Rational Software Modeler Tivoli
MonitoringWebSphere
Tools
AnalystAnalyst ArchitectArchitect DeveloperDeveloper TesterTester Deployment Manager
Deployment Manager
Project Manager
ExecutiveRational Portfolio Manager
Rational Unified Process Rational ClearCase Rational ClearQuest
Rational RequisitePro Rational TestManager Rational ProjectConsole
IBM Software Group
4
Eclipse
Rational Software Architect
• UML Language Transforms• Structural Review & Control• C/C++ Development Tools
Design and construction tools
Rational SoftwareModeler
• UML 2.0 Pattern/Transform Authoring
• Reusable Asset Browser
Rational ApplicationDeveloper
Rational WebDeveloper
• Web Development• Web Services Development• Rich Client Development• XML & Database Tools• 4GL Development
• J2EE/EJB & Portal Development• Component Testing• Code Review & Runtime Analysis• UML Visual Editors• Configuration
Management
IBM Software Group
5
IBM Rational Application Developer
ClearCase LT
RUP Configuration for J2EE
IBM Rational Web Developer for WebSphere Software
UML Visual Editors• Class diagrams for Java/EJB structure• Sequence diagrams for method body
visualization• IDEF1X/IE diagrams for Database and
XML schema• Dynamic topic diagrams• Javadoc integration• Visual refactoring
Code Analysis Tools• Both static source code analysis
and dynamic runtime analysis• Source code analysis for rule
violation detection: Globalization, J2EE/J2SE Best Practices, Private API Usage, Performance
• Sequence diagram runtime trace with performance, thread and code coverage annotation
• Advanced memory leak detection• Remote data collection across
multiple servers• User-defined run-time probes• Interactive reports and metrics
J2EE/EJB Tooling• J2EE construction tools• Supports WebSphere and
WebLogic• Supports J2EE 1.3 and 1.4• Rapid Deployment for WAS v6• Integrated WAS test environments• O/R mapping
UML Visual Editors
Code Analysis Tools
Portal/Portlet Design Tools
J2EE/EJB Tooling
Component/Unit Test
IBM Rational Application Developer for WebSphere Software
Follow on to WebSphere Studio Application Developer Component/Unit Test• JUnit-based testing of Java components,
EJBs and Web Services• Test prioritization recommendation based
on code analysis• Automated test case generation through
usage of test patterns• Datapool editor for data-driven testing• Optimized unit testing through a set of
metrics in the test creation wizard• Test creation wizard offers a set of test
patterns to automatically generate test
Portal/Portlet Design Tools• Visual Portal site and page layout tools• Visual Portlet layout and preview• Integrated Portal test environment
IBM Software Group
6
IBM Rational Software Architect
ClearCase LT
RUP Configuration for SW Architects
IBM Rational Software Architect Product Overview
Application Developer
C/C++ Development Tools
Software Modeler
UML Language Transforms
Java Structural Analysis
WSAD v6• JSF, SDO, Struts• Java GUI editor• Web diagram editor• Site designer• Web Services development tools• Database editing tools• EGL• EJB development tools• UML code editors for EJB, Java, and
Data• Static Analysis• Runtime Analysis• Component test automation• Portal/Portlet development tools
Modeler• UML 2.0 Diagrams for
Class, Communication, Component, Composite Structure, Deployment, Activity, Sequence, State, and Use Case
• OCL Support• Automatic diagram
generation• Pattern content• Pattern/Transform
authoring framework and services
• Extensive open API• Java-based “scripting” for
extensibility• HTML and XML based
data extraction and reporting
• Extensive printing• RAS tools
C/C++ Tools• C/C++ editors and build management• Compiler and debugger integration• UML code editors
UML Language Transforms• Sample UML-to-code transforms for
EJB, Java, and C++• Selective language to UML harvesting
Application Analyzer• Automatic anti-pattern and
pattern detection• Architectural discovery,
analysis, metrics, and stability reporting
• Implementation level architectural rules
IBM Software Group
7
Why Do Designer/Developer Testing? The designer knows their design and developer knows their code
better than anyone else Knows what should be tested first and how a program is supposed to
behave under certain conditions
Ensure Quality early in the Lifecycle Before the application goes to QA
Independent of whatever methodology is used (waterfall, iterative)
Provides the developer and team confidence Can ensure that the application has already gone through ‘some of its paces’
before it undergoes more tests
Everyone says that designer/developer testing is a good idea but it has not been practiced widely because of a lack of adequate tools!
IBM Software Group
8
Why must software testing go beyond symptoms analysis and debugging?Why must software testing go beyond symptoms analysis and debugging?
Every developer knows testing ensures quality code… But few do more than debug
Debugging is not testing! Systematic testing tools and methods are
necessary to ensure early and cost-effective problem discovery
A debugger details symptoms, but flaws’ solving requires a diagnosis Runtime analysis is a key practice for
simplifying the diagnosis of issues impacting reliability, scalability and durability
IBM Software Group
9
Cost of Poor Quality
Software bugs cost the U.S. economy an estimated $59.5 billion annually
Improved testing infrastructure could reduce this cost by about a third, or $22.2 billion
Source: NIST 2002
IBM Software Group
10
Overcome the Challenges…
IBM Rational Software Architect fully supports developer testing
RSA will assist in overcoming the issues of: Building scalable Java/J2EE applications
Maximizing development speed
Eliminating software defects
Delivering interoperable applications based on industry standards
Improving application design, quality and performance
IBM Software Group
11
Benefits of IBM Rational Software Architect
Assist in overcoming challenges by: Pattern and Transformation Model Analysis Analyzing the architecture of an application
– Architecture Discovery Validating the code for correctness and compliance
– Static Analysis
– Rule-based static analysis tool for automatic validation of Java code Ensuring reliability and usability
– Component Test
– Create, edit, deploy and execute automated tests for Java components, EJBs and Web Services
Identifying optimum performance
– Runtime Analysis
– Using the Performance Analysis, Memory Leak Analysis, Line Level Code Coverage, Thread Analysis and User Defined Probes features.
IBM Software Group
12
Model Transformation and Model-Driven Architecture
Model-Driven Architecture (MDA) Models drive development at every stage in the design and construction of
an application.
Modeling begins at a high level of abstraction and works down to fine details over the software lifecycle.
Model Transformation makes MDA possible Transform high-level models into detailed models, based on a consistent
scheme.
Transform one type of model into another across platforms.
IBM Software Group
13
Classifications of Models in MDA
Computation-IndependentModel
Platform-IndependentModel
Platform-SpecificModel
More Abstract
More Specific
IBM Software Group
14
Transformations
Used to transform models: From one type of model to another Across models of the same type Across levels of abstraction
Can cause a global change in a model A transform can extend another transform
Transformation ToolModel Model
Transformation Definition
IBM Software Group
15
Applying Transformations in Software Architect The following transformations
are built into Software Architect: UML to C++ UML to EJB UML to Java
Model-to-model transformations can be custom built.
Platform-Independent Model Platform-Specific Model
IBM Software Group
16
A design pattern in Software Architect is a transformation that occurs: Within a single metamodel
UML to UML Java to Java
Within the same model and at the same level of abstraction: Design model to design
model Code to code
Patterns usually affect small areas of the model when applied.
Patterns in Software Architect
IBM Software Group
17
Patterns in Software Architect (cont.)
In Software Architect, patterns: Are embodied by executable code (in an Eclipse
plug-in) Can be shared as Reusable Asset Specification
(RAS) assets Can have associated transformation extensions
Transform model elements to code.
IBM Software Group
18
Apply a Pattern
Drop a parameter onto an existing model element to apply the pattern and make that element an argument.
Drag and drop a pattern from the Pattern Explorer.
Right-click a pattern to open the Apply Pattern wizard to apply the pattern and create or bind arguments.
2 3
1
IBM Software Group
19
Model Validation: Validating Model Semantics
Check for broken semantic rules According to model's language
Adherence to UML requirements, logic, structures, and usage
To validate the model: On the Modeling menu, click Run
Validation.
Right-click the model in the Model Explorer view or diagram and click Run Validation.
IBM Software Group
20
Model Analysis: Validating Traceability
Use Model Analysis to discover issues with traceability relationships between model elements: No traceability path to an implementation or
a specification Broken trace relationships Circular trace relationships Implied access violations
IBM Software Group
21
Architecture Discovery
Creates diagrams of code to help understand the architecture of an application better
Discover Patterns (Gang-of-Four) Decide what patterns to follow when editing an application
Anti-patterns Looks for dependencies between classes and modules
Assess the impact of change
IBM Software Group
22
Architectural Analysis and Discovery Automatic generation of “topic” diagrams based on the results
of the code analysis
High-level software visualization
Application architecture is reflected in the running code Analyzing code can
help assess its maintainability
Anti-pattern and pattern detection Detection of cyclic
dependencies, hubs, breakable, etc.
IBM Software Group
23
Static Analysis – Validate Code for Correctness and Compliance
Code Review Automate various manual (visual) inspections of code
Unification of quality acceptance tests for all developers working on the same project
Improve efficiency and productivity
– Higher quality of code
– Less time spent debugging
– Improved maintainability and readability of code
IBM Software Group
24
Code Review Benefits
Finds problems and recommends solutions
Ensures adherence to best practices
>230 Rules provided with RAD
Provides a “Quick Fix” for over 25% of the rules
Provides “Quick Fix All” for fixes which don’t require user interaction.
Rules can be customized
Supplied Code Review
Quick Code Review
Complete Code Review
Globalization Code Review
J2SE Best Practices Code Review
J2EE Best Practices Code Review
Structural Analysis Code Review (with Rational Software Architect)
IBM Software Group
25
Static Analysis – Validate Code for Correctness and Compliance
Across the Development Team: Code Review
Enables implementation and enforcement of coding guidelines for the whole team and not just one individual developer
Implementation of a unique Coding Style for the team
Sharing between team members:
Configurations
Rule selection
User-defined rules
Results of a code review
IBM Software Group
26
Code Review Rules can be created
based on rule templates.
The following are the types of rules which can be created:
IBM Software Group
27
Code Free J2EE Unit Testing and Debugging
Built-in Unit Test Environment allows for the configuration of multiple unit test servers
Local servers including WAS 5.x and 6, Apache TomCat, TCP/IP Monitoring Server, BEA WebLogic V6 through V8
Remote servers including external WAS 5.x and 6.0 Application Server
Built-in EJB Test client provides quick and complete EJB testing
No coding necessary to test any EJB!
JNDI Browser
J2EE based application
Runs in Web Browser
IBM Software Group
28
Component Test – Ensure Reliability and Usability Find and fix defects early in the development
cycle and automate regression testing Speeds development of Enterprise
Application
Improve the overall quality of built Application
Enable easy creation, execution and maintenance of dynamic unit tests of J2EE components Java classes (J2SE 1.4)
EJBs (1.1 and 2.0) Both remote and local interfaces
Web Services J2EE based and .NET Web Services
Based on JUnit framework and the open source Hyades project
IBM Software Group
29
Component Test – Ensure Reliability and Usability Test Guidance
Several views of Enterprise Application Components A set of metrics are provided in the test creation
wizard Structural metrics that highlight dependencies
between components Complexity metrics that highlight intrinsic
component complexity Coverage Metrics to assess the completeness of
tests
Automated Test Generation via Test Patterns Alleviate the burden of writing test scripts from
scratch Help users define more complex and complete unit
tests Test creation wizard offers a set of test patterns to
automatically generate tests from code analysis and user selections
IBM Software Group
30
Component Test – Ensure Reliability and Usability Data Driven Testing
Accelerate the creation of tests
Allow to reuse test scenarios with multiple sets of data
Automate regression testing
Provide detailed test results
Stubs Allow to replace one or several components
with user defined stubs
Enable earlier testing in the development cycle
Run tests without having to set up a database
Provide an easy way to define robustness tests
IBM Software Group
31
Built-in tools helps developer isolate and fix performance problems
Advanced sequence diagramsPerformance CallGraph
Line Level Code Coverage
Advanced Memory Leak Analysis
Dynamic User Defined Probes
Thread Analysis
Profiling tools can seamlessly trace across multiple servers
Runtime Analysis
Server 1 Server 2Agent
ControllerAgent
Controller
Servlet EJBs
Monitor Trace Data
Trace Data
IBM Software Group
32
Runtime Analysis - Identify Optimum Performance Advanced Memory Leak Analysis
Heap-import based Leak Analysis
Import heap dumps into Rational Application Developer
Analyze the heap dumps
View the list of Leak Candidates
Leak Analysis with live agent
How does this work?
– Use the Rational Application Developer GUI to take two heap dumps
– Analyze the heap dumps for leaks
– Graphically browse the leak candidates
IBM Software Group
33
Memory Leak Detector
Results of analysis shows leaking objects
Object Reference Graph shows the reference chain
Object details view
IBM Software Group
34
Probe Toolkit A scriptable byte-code insertion (BCI) framework
Used to insert Java code fragments into the byte-code at runtime to see how a program is behaving
Probe fragments can be executed: at method entry time
at method exit time (either a normal return or as the result of an exception)
at exception handler time (top of catch or finally block)
before the original code in the class static initializer
before every executable unit of code (when source code information is available)
when specific methods are called, where instrumentation is done at the call site, not inside the called method
IBM Software Group
35
Probe Toolkit
Probe fragments can access package, class, and method name
method signature
the this object
arguments
return value
the exception object that caused an exception handler exit to execute, or an exception exit from the method
IBM Software Group
36
Code Coverage Untested code is unreliable
code
Helps deliver high quality code Test what you intend to
deliver You know that unit testing is
complete Helps identify dead code
Produces coverage reports and provides an annotated source view of the code to show line-level code coverage
Works on object code, byte code, or executables
IBM Software Group
37
Thread Analyzer Used to locate thread bottlenecks in code.
IBM Software Group
38
Runtime Analysis - Identify Optimum Performance
Summary Rational Application Developer provides:
Advanced Leak Analysis
Performance Callgraph
Dynamic User Defined Probes
Line level code coverage
Thread Analysis
– ONLY in Rational Application Developer, not in Hyades
IBM Software Group
39
IBM Software Group
40
Session Summary
Now that you have completed this session, you should be able to: Understand where quality fits in the IBM Software Development Platform
Understand why developer testing is important
Identify the challenges that developers face in creating quality code
Identify the benefit of using IBM Rational Application Developer for WebSphere Software to:
Validate the code for correctness and compliance
Ensure reliability and usability
Identify optimum performance
IBM Software Group
41
Additional References
DeveloperWorks: Optimizing Java Programs Using IBM Rational Application Developer 6.0.1
DeveloperWorks: Detecting Java leaks using IBM Rational Application Developer 6.0
DeveloperWorks Webcast: Improved application development: Part 5, Testing and verifying with Rational tools
DeveloperWorks Webcast: Understanding runtime analysis: Application tuning with IBM Rational Application Developer
IBM Software Group
42
IBM Software Group
43