SlideShare una empresa de Scribd logo
1 de 51
IBM RAD

Section - 6) Debugging and Testing

Vikas Manoria
IT Specialist – IBM Academic Initiative
vmanoria@in.ibm.com

© 2008 IBM Corporation
IBM AI - RAD

Section 6 - Debugging and Testing (18%)









Manage breakpoints
Step through and examine Java code
View variables and execute, display and inspect
expressions
Create and run code in Scrapbook page
Perform JSP debugging
Use step-by-step debugging
Locate and view WebSphere application server logs
Perform unit testing using JUnit
IBM AI - RAD

Debug Tooling
 Rational Application Developer supports debugging in
several programming languages and environments
-

Java
Active Script (client-side JavaScript or Visual Basic script)
SQL Stored Procedures, SQLJ
EGL, XSL Transformations
Mixed language
WebSphere Application Server environment (includes
servlets, JSPs, and EJBs)

 It is opened under the following conditions
-

Execution hits a breakpoint that you inserted
An uncaught exception occurs
You select the debug button (
) on any tool bar
IBM AI - RAD

Debugger Capabilities

Modify
- Code

while in the debugger
- Data values while stepping through code

While in the debugger
- Set

breakpoints
- No unnecessary editions are created
- Multithreading support

To debug your code you do not have to
- Recompile

in the Java editor, or
- Add source code, such as System.out.println(...)
into the code
IBM AI - RAD

Debugger Perspective

Execution
Stack Frame

Debugger can
be used to inspect,
change, and step
through code

The source can
be changed,saved,
and resumed from
within the debugger

Source

Variables Pane
IBM AI - RAD

Stack Frames
The debugger displays lists of stack frames before exception or
breakpoint occur
Stack frames
-

Correspond to a called method
Are in reverse chronological order -- Last one executed is first

Any stack frame can be selected and “dropped to.” The code is then
re-executed
Choose a frame and
select the Relaunch
option defined in the
pop-up
- Variable values are
not reset when a
stack frame is
dropped
-
IBM AI - RAD

Stepping Through Code Commands
1. Resume - Continues execution until breakpoint or thread ends
2. Suspend - Interrupts a running thread
3. Terminate - Ends the execution of the selected thread
4. Step Into – Steps into a method call and executes the first line of
code in that method
5. Step Over - Executes the next line of code in the current method
6. Step Return - Continues execution until the end of the current
method (until a return)
7. Step with Filters – Continues execution until the next line of code
which is not filtered out

1 2 3

4 5

6

7
IBM AI - RAD

Step Filtering: Java
 Used to avoid stepping into specified packages and classes
while debugging
 Affects Step Into and Step Return while debugging
-

Specified packages and classes will be stepped over

 Is set in the Preferences dialog
-

Window > Preferences > Java > Debug > Step Filtering

 They are independent of the Step Filters, which are used during
step-by-step debugging of J2EE and Web Objects
IBM AI - RAD

Configuring Step Filtering: Java
 Toggle the Use Step Filters button in the Debug view toolbar
-

Each of the step actions (over, into, return) will then apply to the set
of step filters which are defined in the preferences
IBM AI - RAD

Breakpoints View

Lists all the breakpoints you have set in the
workbench, as well as Java Exception breakpoints
Double-click a breakpoint to display its location
- Enable or disable breakpoints, add or delete them
-

Add Java Exception breakpoint
Skip all breakpoints
Show Breakpoints Supported by Selected Target
Remove All Breakpoints
Remove Selected Breakpoints
IBM AI - RAD

Exception Breakpoints
Exception can be enabled as breakpoints in the Breakpoint
view
Execution will suspend wherever the exception is raised
- Can specify “caught”, “uncaught” or both.
-
IBM AI - RAD

Where Are You Allowed to Enter Breakpoints?
 Breakpoints are set on an executable line of a program
 If you try to add a breakpoint on a line where there is no
executable code, Rational Application Developer will either:
-

Add one at the next possible location (in Java code)
Display a red error message in the status bar
IBM AI - RAD

Configuring Breakpoint Properties
 You can enable or disable breakpoints
-

Newly added breakpoints are enabled by default

 Hit count breakpoints
-

The thread execution suspends when the breakpoint is hit for the nth time
The breakpoint is disabled until either it is re-enabled or its hit count is
changed

 Conditional breakpoints
-

Must evaluate to a boolean
Only invoked if condition
evaluates to true or value
changes

 Filtering: filter per thread
 Method breakpoints suspend
method Entry or Exit
IBM AI - RAD

The Variables View
 Examine the contents of variables when a thread suspends
-

Top stack frame of the thread is automatically selected
Visible variables of the selected stack frame are displayed
IBM AI - RAD

Viewing and Changing Variables During Debugging
 Change a value by selecting Change Variable Value from the
context pop-up menu on a particular variable
1. Show type names adds the type before variable identifiers
2.Other options can be set using the toolbar menu


For example: Detail Pane > the number of lines shown
1

2
IBM AI - RAD

Data in the Expressions View
 In the Expressions view, you can inspect data from a
scrapbook page or a stack frame of a suspended thread
 The view is not initially open in the debug perspective
-

It opens automatically when an item is added to the view

 To inspect data in this view, select a variable in the code and
press Ctrl-Shift-i twice
-

The first time opens a window with the expression
The second time moves the contents of the window to the Expressions
view
IBM AI - RAD

Run Sample Code with Scrapbook Pages
 Scrapbook pages allow you to evaluate and test a
small section of code without creating an entire class.
-

-

To evaluate a code fragment in the scrapbook page, highlight
an expression and select Display from the pop-up menu.
Add other classes or packages using Set Imports.
IBM AI - RAD

Create a New Java Scrapbook Page
 Start the New Java Scrapbook
wizard.
-

In the Java perspective, select File >New
>Other.

-

Expand Java -> Java Run/Debug and
select Scrapbook Page.

-

Click Next.

 Specify the name and location for the
new Java scrapbook page.
-

Specify a location for the scrapbook page.

-

Choose a name for the scrapbook page.

-

Click Finish.
IBM AI - RAD

Debugging JavaServer Pages
You cannot set breakpoints on lines that only contain HTML
You can set breakpoints in:
-

Java code
JSP, Struts, and JSF tags
JavaScript

Select the JSP file and click Debug As > Debug on Server
from the context pop-up menu
-

The server automatically starts in debug mode
The debugger stops at the breakpoint and displays the JSP

Step through the JSP file, examine and change variable values
Refresh the JSP in the Web browser to view changes made
while debugging
-

-

The state of the application is not lost, and the server recognizes your
changes
You do not need to republish to see JSP changes
IBM AI - RAD

What Is Remote Debugging?

 The application to be debugged is on a different
machine than the workstation running Rational
Application Developer
IBM AI - RAD

Configuring a Remote Server for Debugging

Turn on debug
information
-

Window > Preferences
> Java > Compiler

Start the debugger
using a remote launch
configuration
-

Specify the connection
properties
IBM AI - RAD

Step-By-Step Debugging: J2EE and Web Objects
Works at a much higher level and stops on entry to every Web
object loaded by the server
Use the step-by-step mode to get to the Web object you want to
debug
-

Then use traditional stepping to control debugging at the statement level
Step into, step over, step return

When entering a Web object, you decide whether to Skip or
Step Into the object
You can apply filters to further define which Web objects to
automatically skip
-

Run/Debug > Java and Mixed Language Debug > Step Filters
IBM AI - RAD

Eclipse Test and Performance Tools Platform (TPTP)
Open-source project for creating extensible testing, tracing,
profiling, and monitoring tools on the Eclipse platform.
Provides the following test suites:
-TPTP

JUnit Plug-in Test
-TPTP JUnit Test
-TPTP Manual Test
-TPTP URL Test

You can add a Test Case to an existing test suite
Records HTTP Interactions using HTTP Recording
-Can

create a test suite from an existing recording

Can create the following assets
-Artifact
-Datapool
-Deployment
-Location
IBM AI - RAD

Integrated Rational Agent Controller
 In the past, you needed the services of the standalone Rational
Agent Controller before they could test an application.
- Even when you tried to test an application locally, including
the local WebSphere Test Environment, the Rational Agent
Controller would have to be installed on the local machine.
 The Integrated Rational Agent Controller is a new feature in
workbench that allows you to test an application locally without
needing the standalone Rational Agent Controller on the local
machine.
- If you test on a remote machine, you still need the Rational
Agent Controller on that remote machine.
- There is no need to install and configure on a local copy of
Rational Agent Controller when you are testing locally.
IBM AI - RAD

Steps to Create and Run Tests

 Create a Test Project (Java Project) in the workspace.
-

A Test Project stores tests and results.

 Create sub-folders to organize your code, for example:
-

tests folder for test suites
assets folder for artifacts, deployments, and datapools
 Can be further broken down into sub-folders for each asset type

-

results folder for test results

 Create Test Suites and Test Cases.
-

-

A Test Suite defines a scenario through a collection of test
cases.
A Test Case specifies what to do during the test.
IBM AI - RAD

Create a TPTP Test Suite
1.In Test Navigator, right-click your test project and select
New  Test Element.
2.Choose one of the three indicated test suite types:

a.
b.

c.

TPTP JUnit Test suite definition to test Java classes.
TPTP Manual Test suite to direct a user to perform steps and
enter verdicts.
TPTP URL Test suite to test Web applications.

3.Click Next.
IBM AI - RAD

Create a Test Project
 Switch to the Test perspective
-

Window > Open Perspective > Other > Test
You will need to select the Show All check box in the Open Perspective
dialog, and then Confirm enablement.

 From the main menu bar, select File > New > Project > Java
Project.
-

Enter a Project name
Click Next
On the Java Settings page, click the Projects tab and add any projects
that you will be testing classes in
 For example, the LibraryTest project needs access to the classes in the
LibraryUtility project so that test suites can see the classes

-

Click Finish

 In the Test Navigator, add folders to organize the different test
items you are going to create
-

Test Suites, test cases, recording, and artifacts
IBM AI - RAD

Create a TPTP JUnit Test (1 of 2)
1.Switch to the Test
perspective.
2.From the Test Navigator
view, bring up the popup menu and select New
> Test Element > TPTP
JUnit Test.
3.Click Next.
4.Select a Package and
name the test suite.
5.Click Next.
IBM AI - RAD

Create a TPTP JUnit Test (2 of 2)

6.Specify the folder for
the Test.
7.Click Finish.
IBM AI - RAD

TPTP JUnit Test Editor
 Use the Test Methods tab to add methods to the underlying
JUnit Test case.
 Use the Behavior tab to add loops and invoke test methods.
-

The test methods can be from the underlying JUnit Test case, or from
other Tests.
IBM AI - RAD

Editing the Underlying Test Case

 In the Test Navigator, right-click the Test suite and
select Open Source Code.
 Add test code to the methods that you defined in the
Test editor.
 Save your changes.
IBM AI - RAD

Running the TPTP JUnit Test

 In the Test Navigator, right-click the
Test and select Run As > Test
 Examine the results in the Test Log
on the following page
-

-

In the Test Navigator, double-click the
execution
Red X’s = failure
IBM AI - RAD

Test Log
IBM AI - RAD

Create a TPTP Manual Test
1.Switch to the Test
perspective.
2.From the Test Navigator
view, bring up the pop-up
menu, right-click and
select New >Test
Element >TPTP Manual
Test.
3.Click Next.
4.Select a folder and name
the test suite.
5.Click Finish.
IBM AI - RAD

TPTP Manual Test Editor
 Use the Test Cases tab to add Test case instructions.
 Use the Behavior tab to add loops and invoke test methods.
-

The test methods can be from the underlying local Test, or from other
Manual Tests.
IBM AI - RAD

Running the TPTP Manual Test

 In the Test Navigator, right-click the Test and select Run As >
Test.
 The Manual Test View window opens.
-

Follow the instructions for each task.
Enter detailed information.





-

Verdict: Error, Fail, Inconclusive, or Pass
Enter a text description
Reason: None, See description, Success, Unknown, or User Intervention
Attach any required files

Click Next for the next task.
IBM AI - RAD

Manual Test View
IBM AI - RAD

Unit Test Web Application Components

Steps to create a URL Test Case for Web
applications:
1. Record

HTTP request and response using the URL
Recording Test Element.
2. Create a TPTP URL Test based on the HTTP request and
response messages.
3. Customize the Test Cases by editing the HTTP request and
response messages.
4. Generate an executable test based on the URL Test Suite.
5. Execute the test against the Web application.
6. Analyze the results from running the URL Test Case.
IBM AI - RAD

Record an URL Test Case
1. Switch to the Test perspective.
2. In Test Navigator view, right-click the test project and select
New > Test Element > Recording > HTTP Recording.
3. Click Next.
4. When prompted, select a folder in the previously created Test
project.
5. Provide an unique name for the new HTTP Recording and
click Finish.
6. Wait for the Recorder Control to
start the external Web browser.
IBM AI - RAD

Create URL Test Cases

 Interact with your Web application through the external
Web browser.
 Either close the Web browser or click Stop Recording
in the Recorder Control view.
 A new Test Suite and a series of Test Cases are
automatically created.
-

One Test Case appears for each HTTP request
HTTP response messages are not captured

 Open the URL Test Suite to customize the individual
HTTP requests.
IBM AI - RAD

Customize URL Test Cases

1

2
IBM AI - RAD

Configure the Sequence of URL Test Cases

2
1
IBM AI - RAD

Generate an Executable URL Test

 In the Test Navigator,
right-click the TPTP URL
Test Suite and select
Generate.
 At this point, you have a
single Java class that
executes a series of
HTTP requests according
to your settings in the
URL Test Suite.
IBM AI - RAD

Run the URL Test and Examine the Result
 In the Navigator view, right-click the URL Test and select Run >
Run Test
-

Double-click the execution to examine the results
IBM AI - RAD

Create Graphical URL Test Reports

 Right-click a URL Hyades Test Suite and select
Report.
-

-

-

-

Page Hit Rate measures the average number of hits per
second for every URL resource
Page Response Time measures the average number of
seconds needed by the Web application to return a response
Test Pass Report creates a report with presenting only the
most recent execution results for each selected test within a
specified period of time
Time Frame Historic creates a report with presenting all of
the executions run within a finite period of time
IBM AI - RAD

Checkpoint
1.In the middle of debugging a method, you decide you
want to skip ahead to the point where control is handed
back to the caller. What can you do?
2.What information is shown in the debug view?
3.How do you know that a breakpoint has some condition
set?
4.On what lines of code are you able to enter a breakpoint?
5.A step filter is set for java.io.* and java.util.*. Would the
same result be achieved by simply setting java.*?
6.What is step-by-step debugging?
IBM AI - RAD

Checkpoint answers
1.Click the Step return button, or press F7.
2.Stack frames, process threads, terminated
launches.
3.There is a question mark overlay on the icon.
4.Executable lines.
5.Yes and no. It would certainly cover the two
packages, but it would also cover all other java.
Packages, and this may not be what is required.
6.Step-by-step debugging an application running on a
Server will stop at entry to every object loaded by
the JVM or server.
IBM AI - RAD

Checkpoint
1.What type of test do you create in order to unit test:
a.
b.
c.

A Java class?
A JavaServer Page (JSP)?
A Servlet?

2.How do you edit the test case of JUnit Test?
3.How do you check the test result for a Java class?
IBM AI - RAD

Checkpoint answers
1. a) TPTP JUnit Test, b) and c) TPTP URL Test
2.In the Navigator view, right-click on the Test and
select Open Source Code.
3.In the Navigator view either
•
•

Expand the test execution
Double-click the test execution to view the Test Log
IBM AI - RAD

Lab
 Debug Java application
 Breakpoints and debug views
 Step through code
 Variables and examine views
 Debug Web application
 Start server in debug mode
 Step-by-step debugging
 Create a Test project
 Create JUnit test cases
 Run and analyse test cases
IBM AI - RAD

Grazie

Hebrew

Italian

Gracias

Russian

Spanish

Arabic

Thank You

Merci

French

German

English

Thai

Korean
Japanese

Portuguese

Danke

Traditional Chinese

Simplified Chinese

Obrigado

Más contenido relacionado

La actualidad más candente

La actualidad más candente (19)

software testing
software testingsoftware testing
software testing
 
Testing and types of Testing
Testing and types of TestingTesting and types of Testing
Testing and types of Testing
 
Software testing
Software testingSoftware testing
Software testing
 
Software Testing Strategies
Software Testing StrategiesSoftware Testing Strategies
Software Testing Strategies
 
Software Testing (Contd..) SDLC Model
Software Testing (Contd..) SDLC ModelSoftware Testing (Contd..) SDLC Model
Software Testing (Contd..) SDLC Model
 
Research issues in object oriented software testing
Research issues in object oriented software testingResearch issues in object oriented software testing
Research issues in object oriented software testing
 
Software testing
Software testingSoftware testing
Software testing
 
Python: Object-Oriented Testing (Unit Testing)
Python: Object-Oriented Testing (Unit Testing)Python: Object-Oriented Testing (Unit Testing)
Python: Object-Oriented Testing (Unit Testing)
 
Software testing & its technology
Software testing & its technologySoftware testing & its technology
Software testing & its technology
 
Software testing methods
Software testing methodsSoftware testing methods
Software testing methods
 
Structural and functional testing
Structural and functional testingStructural and functional testing
Structural and functional testing
 
Software Testing & Debugging
Software Testing & DebuggingSoftware Testing & Debugging
Software Testing & Debugging
 
Software Testing
Software TestingSoftware Testing
Software Testing
 
Ppt19
Ppt19Ppt19
Ppt19
 
Software Testing Techniques: An Overview
Software Testing Techniques: An Overview Software Testing Techniques: An Overview
Software Testing Techniques: An Overview
 
unit testing and debugging
unit testing and debuggingunit testing and debugging
unit testing and debugging
 
Chapter 14 software testing techniques
Chapter 14 software testing techniquesChapter 14 software testing techniques
Chapter 14 software testing techniques
 
7 stages of unit testing
7 stages of unit testing7 stages of unit testing
7 stages of unit testing
 
Testing chapter updated (1)
Testing chapter updated (1)Testing chapter updated (1)
Testing chapter updated (1)
 

Similar a debugging and testing

6) debugging and testing
6) debugging and testing6) debugging and testing
6) debugging and testingtechbed
 
E catt tutorial
E catt tutorialE catt tutorial
E catt tutorialNaveen Raj
 
Using galen framework for automated cross browser layout testing
Using galen framework for automated cross browser layout testingUsing galen framework for automated cross browser layout testing
Using galen framework for automated cross browser layout testingSarah Elson
 
Siebel Open UI Debugging (Siebel Open UI Training, Part 7)
Siebel Open UI Debugging (Siebel Open UI Training, Part 7)Siebel Open UI Debugging (Siebel Open UI Training, Part 7)
Siebel Open UI Debugging (Siebel Open UI Training, Part 7)Tech OneStop
 
Java: Finding Bugs, Fixing Bugs in IBM Domino Designer and XPages
Java: Finding Bugs, Fixing Bugs in IBM Domino Designer and XPagesJava: Finding Bugs, Fixing Bugs in IBM Domino Designer and XPages
Java: Finding Bugs, Fixing Bugs in IBM Domino Designer and XPagespanagenda
 
Useful practices of creation automatic tests by using cucumber jvm
Useful practices of creation automatic tests by using cucumber jvmUseful practices of creation automatic tests by using cucumber jvm
Useful practices of creation automatic tests by using cucumber jvmAnton Shapin
 
Dusan Lukic Magento 2 Integration Tests Meet Magento Serbia 2016
Dusan Lukic Magento 2 Integration Tests Meet Magento Serbia 2016Dusan Lukic Magento 2 Integration Tests Meet Magento Serbia 2016
Dusan Lukic Magento 2 Integration Tests Meet Magento Serbia 2016Dusan Lukic
 
B4usolution performance testing
B4usolution performance testingB4usolution performance testing
B4usolution performance testingHoa Le
 
Automated Acceptance Testing Example
Automated Acceptance Testing ExampleAutomated Acceptance Testing Example
Automated Acceptance Testing ExampleHani Massoud
 
Java developer trainee implementation and import
Java developer trainee implementation and importJava developer trainee implementation and import
Java developer trainee implementation and importiamluqman0403
 
Testing in Craft CMS
Testing in Craft CMSTesting in Craft CMS
Testing in Craft CMSJustinHolt20
 
Less10 2 e_testermodule_9
Less10 2 e_testermodule_9Less10 2 e_testermodule_9
Less10 2 e_testermodule_9Suresh Mishra
 

Similar a debugging and testing (20)

6) debugging and testing
6) debugging and testing6) debugging and testing
6) debugging and testing
 
E catt tutorial
E catt tutorialE catt tutorial
E catt tutorial
 
Using galen framework for automated cross browser layout testing
Using galen framework for automated cross browser layout testingUsing galen framework for automated cross browser layout testing
Using galen framework for automated cross browser layout testing
 
Siebel Open UI Debugging (Siebel Open UI Training, Part 7)
Siebel Open UI Debugging (Siebel Open UI Training, Part 7)Siebel Open UI Debugging (Siebel Open UI Training, Part 7)
Siebel Open UI Debugging (Siebel Open UI Training, Part 7)
 
Java: Finding Bugs, Fixing Bugs in IBM Domino Designer and XPages
Java: Finding Bugs, Fixing Bugs in IBM Domino Designer and XPagesJava: Finding Bugs, Fixing Bugs in IBM Domino Designer and XPages
Java: Finding Bugs, Fixing Bugs in IBM Domino Designer and XPages
 
Jmh
JmhJmh
Jmh
 
Qtp
QtpQtp
Qtp
 
JMeter_ Cubet Seminar ppt
JMeter_ Cubet Seminar pptJMeter_ Cubet Seminar ppt
JMeter_ Cubet Seminar ppt
 
Useful practices of creation automatic tests by using cucumber jvm
Useful practices of creation automatic tests by using cucumber jvmUseful practices of creation automatic tests by using cucumber jvm
Useful practices of creation automatic tests by using cucumber jvm
 
Qtp basics
Qtp basicsQtp basics
Qtp basics
 
Dusan Lukic Magento 2 Integration Tests Meet Magento Serbia 2016
Dusan Lukic Magento 2 Integration Tests Meet Magento Serbia 2016Dusan Lukic Magento 2 Integration Tests Meet Magento Serbia 2016
Dusan Lukic Magento 2 Integration Tests Meet Magento Serbia 2016
 
B4usolution performance testing
B4usolution performance testingB4usolution performance testing
B4usolution performance testing
 
Automated Acceptance Testing Example
Automated Acceptance Testing ExampleAutomated Acceptance Testing Example
Automated Acceptance Testing Example
 
About QTP 9.2
About QTP 9.2About QTP 9.2
About QTP 9.2
 
About Qtp_1 92
About Qtp_1 92About Qtp_1 92
About Qtp_1 92
 
About Qtp 92
About Qtp 92About Qtp 92
About Qtp 92
 
Java Lab
Java LabJava Lab
Java Lab
 
Java developer trainee implementation and import
Java developer trainee implementation and importJava developer trainee implementation and import
Java developer trainee implementation and import
 
Testing in Craft CMS
Testing in Craft CMSTesting in Craft CMS
Testing in Craft CMS
 
Less10 2 e_testermodule_9
Less10 2 e_testermodule_9Less10 2 e_testermodule_9
Less10 2 e_testermodule_9
 

Más de Sevajothi Crafts

Sevajothi-crafts-pricelist.pdf
Sevajothi-crafts-pricelist.pdfSevajothi-crafts-pricelist.pdf
Sevajothi-crafts-pricelist.pdfSevajothi Crafts
 
Report-No.-3-of-2023-Performance-Audit-on-IFHRMS-Tamil-065278522d89142.419916...
Report-No.-3-of-2023-Performance-Audit-on-IFHRMS-Tamil-065278522d89142.419916...Report-No.-3-of-2023-Performance-Audit-on-IFHRMS-Tamil-065278522d89142.419916...
Report-No.-3-of-2023-Performance-Audit-on-IFHRMS-Tamil-065278522d89142.419916...Sevajothi Crafts
 
Occupational Safety, Health and Working Condition (Tamil Nadu) Rules, 2022.pdf
Occupational Safety, Health and Working Condition (Tamil Nadu) Rules, 2022.pdfOccupational Safety, Health and Working Condition (Tamil Nadu) Rules, 2022.pdf
Occupational Safety, Health and Working Condition (Tamil Nadu) Rules, 2022.pdfSevajothi Crafts
 
Scholarship - Physical Verification.pdf
Scholarship - Physical Verification.pdfScholarship - Physical Verification.pdf
Scholarship - Physical Verification.pdfSevajothi Crafts
 
GO_Ms_No_303_Finance-_Pay-Cell__Dated_11_10_2017_FC-Final-2(1).pdf
GO_Ms_No_303_Finance-_Pay-Cell__Dated_11_10_2017_FC-Final-2(1).pdfGO_Ms_No_303_Finance-_Pay-Cell__Dated_11_10_2017_FC-Final-2(1).pdf
GO_Ms_No_303_Finance-_Pay-Cell__Dated_11_10_2017_FC-Final-2(1).pdfSevajothi Crafts
 
THENCHITTU - SEP - 2023.pdf
THENCHITTU - SEP - 2023.pdfTHENCHITTU - SEP - 2023.pdf
THENCHITTU - SEP - 2023.pdfSevajothi Crafts
 
sjt pms save water notice.pdf
sjt pms save water notice.pdfsjt pms save water notice.pdf
sjt pms save water notice.pdfSevajothi Crafts
 
Election offers dinamalr20
Election offers dinamalr20Election offers dinamalr20
Election offers dinamalr20Sevajothi Crafts
 
1072007735 social awareness and cyber safety up 10.9.13
1072007735 social awareness and cyber safety   up 10.9.131072007735 social awareness and cyber safety   up 10.9.13
1072007735 social awareness and cyber safety up 10.9.13Sevajothi Crafts
 
Implementation of guidelines on tobacco control initiative in school reg
Implementation of guidelines on tobacco control initiative in school regImplementation of guidelines on tobacco control initiative in school reg
Implementation of guidelines on tobacco control initiative in school regSevajothi Crafts
 
General elections model code of conduct
General elections model code of conductGeneral elections model code of conduct
General elections model code of conductSevajothi Crafts
 
Road safety under age driving- awareness
Road safety   under age driving- awarenessRoad safety   under age driving- awareness
Road safety under age driving- awarenessSevajothi Crafts
 
Rashtriya indian miltary college admission
Rashtriya indian miltary college admissionRashtriya indian miltary college admission
Rashtriya indian miltary college admissionSevajothi Crafts
 

Más de Sevajothi Crafts (20)

Sevajothi-crafts-pricelist.pdf
Sevajothi-crafts-pricelist.pdfSevajothi-crafts-pricelist.pdf
Sevajothi-crafts-pricelist.pdf
 
Report-No.-3-of-2023-Performance-Audit-on-IFHRMS-Tamil-065278522d89142.419916...
Report-No.-3-of-2023-Performance-Audit-on-IFHRMS-Tamil-065278522d89142.419916...Report-No.-3-of-2023-Performance-Audit-on-IFHRMS-Tamil-065278522d89142.419916...
Report-No.-3-of-2023-Performance-Audit-on-IFHRMS-Tamil-065278522d89142.419916...
 
73watchman.pdf
73watchman.pdf73watchman.pdf
73watchman.pdf
 
Occupational Safety, Health and Working Condition (Tamil Nadu) Rules, 2022.pdf
Occupational Safety, Health and Working Condition (Tamil Nadu) Rules, 2022.pdfOccupational Safety, Health and Working Condition (Tamil Nadu) Rules, 2022.pdf
Occupational Safety, Health and Working Condition (Tamil Nadu) Rules, 2022.pdf
 
Scholarship - Physical Verification.pdf
Scholarship - Physical Verification.pdfScholarship - Physical Verification.pdf
Scholarship - Physical Verification.pdf
 
GO_Ms_No_303_Finance-_Pay-Cell__Dated_11_10_2017_FC-Final-2(1).pdf
GO_Ms_No_303_Finance-_Pay-Cell__Dated_11_10_2017_FC-Final-2(1).pdfGO_Ms_No_303_Finance-_Pay-Cell__Dated_11_10_2017_FC-Final-2(1).pdf
GO_Ms_No_303_Finance-_Pay-Cell__Dated_11_10_2017_FC-Final-2(1).pdf
 
msk-stockoverflow23.pdf
msk-stockoverflow23.pdfmsk-stockoverflow23.pdf
msk-stockoverflow23.pdf
 
DREAM TRS 6 Sept 2023.pdf
DREAM TRS 6 Sept 2023.pdfDREAM TRS 6 Sept 2023.pdf
DREAM TRS 6 Sept 2023.pdf
 
THENCHITTU - SEP - 2023.pdf
THENCHITTU - SEP - 2023.pdfTHENCHITTU - SEP - 2023.pdf
THENCHITTU - SEP - 2023.pdf
 
PUTHU OONCHAL-SEP.pdf
PUTHU OONCHAL-SEP.pdfPUTHU OONCHAL-SEP.pdf
PUTHU OONCHAL-SEP.pdf
 
ShaalaTamil.pdf
ShaalaTamil.pdfShaalaTamil.pdf
ShaalaTamil.pdf
 
sjt pms save water notice.pdf
sjt pms save water notice.pdfsjt pms save water notice.pdf
sjt pms save water notice.pdf
 
blogs.docx
blogs.docxblogs.docx
blogs.docx
 
Election offers dinamalr20
Election offers dinamalr20Election offers dinamalr20
Election offers dinamalr20
 
Election public demands
Election public demandsElection public demands
Election public demands
 
1072007735 social awareness and cyber safety up 10.9.13
1072007735 social awareness and cyber safety   up 10.9.131072007735 social awareness and cyber safety   up 10.9.13
1072007735 social awareness and cyber safety up 10.9.13
 
Implementation of guidelines on tobacco control initiative in school reg
Implementation of guidelines on tobacco control initiative in school regImplementation of guidelines on tobacco control initiative in school reg
Implementation of guidelines on tobacco control initiative in school reg
 
General elections model code of conduct
General elections model code of conductGeneral elections model code of conduct
General elections model code of conduct
 
Road safety under age driving- awareness
Road safety   under age driving- awarenessRoad safety   under age driving- awareness
Road safety under age driving- awareness
 
Rashtriya indian miltary college admission
Rashtriya indian miltary college admissionRashtriya indian miltary college admission
Rashtriya indian miltary college admission
 

Último

Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piececharlottematthew16
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr LapshynFwdays
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embeddingZilliz
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 

Último (20)

Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piece
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embedding
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 

debugging and testing

  • 1. IBM RAD Section - 6) Debugging and Testing Vikas Manoria IT Specialist – IBM Academic Initiative vmanoria@in.ibm.com © 2008 IBM Corporation
  • 2. IBM AI - RAD Section 6 - Debugging and Testing (18%)         Manage breakpoints Step through and examine Java code View variables and execute, display and inspect expressions Create and run code in Scrapbook page Perform JSP debugging Use step-by-step debugging Locate and view WebSphere application server logs Perform unit testing using JUnit
  • 3. IBM AI - RAD Debug Tooling  Rational Application Developer supports debugging in several programming languages and environments - Java Active Script (client-side JavaScript or Visual Basic script) SQL Stored Procedures, SQLJ EGL, XSL Transformations Mixed language WebSphere Application Server environment (includes servlets, JSPs, and EJBs)  It is opened under the following conditions - Execution hits a breakpoint that you inserted An uncaught exception occurs You select the debug button ( ) on any tool bar
  • 4. IBM AI - RAD Debugger Capabilities Modify - Code while in the debugger - Data values while stepping through code While in the debugger - Set breakpoints - No unnecessary editions are created - Multithreading support To debug your code you do not have to - Recompile in the Java editor, or - Add source code, such as System.out.println(...) into the code
  • 5. IBM AI - RAD Debugger Perspective Execution Stack Frame Debugger can be used to inspect, change, and step through code The source can be changed,saved, and resumed from within the debugger Source Variables Pane
  • 6. IBM AI - RAD Stack Frames The debugger displays lists of stack frames before exception or breakpoint occur Stack frames - Correspond to a called method Are in reverse chronological order -- Last one executed is first Any stack frame can be selected and “dropped to.” The code is then re-executed Choose a frame and select the Relaunch option defined in the pop-up - Variable values are not reset when a stack frame is dropped -
  • 7. IBM AI - RAD Stepping Through Code Commands 1. Resume - Continues execution until breakpoint or thread ends 2. Suspend - Interrupts a running thread 3. Terminate - Ends the execution of the selected thread 4. Step Into – Steps into a method call and executes the first line of code in that method 5. Step Over - Executes the next line of code in the current method 6. Step Return - Continues execution until the end of the current method (until a return) 7. Step with Filters – Continues execution until the next line of code which is not filtered out 1 2 3 4 5 6 7
  • 8. IBM AI - RAD Step Filtering: Java  Used to avoid stepping into specified packages and classes while debugging  Affects Step Into and Step Return while debugging - Specified packages and classes will be stepped over  Is set in the Preferences dialog - Window > Preferences > Java > Debug > Step Filtering  They are independent of the Step Filters, which are used during step-by-step debugging of J2EE and Web Objects
  • 9. IBM AI - RAD Configuring Step Filtering: Java  Toggle the Use Step Filters button in the Debug view toolbar - Each of the step actions (over, into, return) will then apply to the set of step filters which are defined in the preferences
  • 10. IBM AI - RAD Breakpoints View Lists all the breakpoints you have set in the workbench, as well as Java Exception breakpoints Double-click a breakpoint to display its location - Enable or disable breakpoints, add or delete them - Add Java Exception breakpoint Skip all breakpoints Show Breakpoints Supported by Selected Target Remove All Breakpoints Remove Selected Breakpoints
  • 11. IBM AI - RAD Exception Breakpoints Exception can be enabled as breakpoints in the Breakpoint view Execution will suspend wherever the exception is raised - Can specify “caught”, “uncaught” or both. -
  • 12. IBM AI - RAD Where Are You Allowed to Enter Breakpoints?  Breakpoints are set on an executable line of a program  If you try to add a breakpoint on a line where there is no executable code, Rational Application Developer will either: - Add one at the next possible location (in Java code) Display a red error message in the status bar
  • 13. IBM AI - RAD Configuring Breakpoint Properties  You can enable or disable breakpoints - Newly added breakpoints are enabled by default  Hit count breakpoints - The thread execution suspends when the breakpoint is hit for the nth time The breakpoint is disabled until either it is re-enabled or its hit count is changed  Conditional breakpoints - Must evaluate to a boolean Only invoked if condition evaluates to true or value changes  Filtering: filter per thread  Method breakpoints suspend method Entry or Exit
  • 14. IBM AI - RAD The Variables View  Examine the contents of variables when a thread suspends - Top stack frame of the thread is automatically selected Visible variables of the selected stack frame are displayed
  • 15. IBM AI - RAD Viewing and Changing Variables During Debugging  Change a value by selecting Change Variable Value from the context pop-up menu on a particular variable 1. Show type names adds the type before variable identifiers 2.Other options can be set using the toolbar menu  For example: Detail Pane > the number of lines shown 1 2
  • 16. IBM AI - RAD Data in the Expressions View  In the Expressions view, you can inspect data from a scrapbook page or a stack frame of a suspended thread  The view is not initially open in the debug perspective - It opens automatically when an item is added to the view  To inspect data in this view, select a variable in the code and press Ctrl-Shift-i twice - The first time opens a window with the expression The second time moves the contents of the window to the Expressions view
  • 17. IBM AI - RAD Run Sample Code with Scrapbook Pages  Scrapbook pages allow you to evaluate and test a small section of code without creating an entire class. - - To evaluate a code fragment in the scrapbook page, highlight an expression and select Display from the pop-up menu. Add other classes or packages using Set Imports.
  • 18. IBM AI - RAD Create a New Java Scrapbook Page  Start the New Java Scrapbook wizard. - In the Java perspective, select File >New >Other. - Expand Java -> Java Run/Debug and select Scrapbook Page. - Click Next.  Specify the name and location for the new Java scrapbook page. - Specify a location for the scrapbook page. - Choose a name for the scrapbook page. - Click Finish.
  • 19. IBM AI - RAD Debugging JavaServer Pages You cannot set breakpoints on lines that only contain HTML You can set breakpoints in: - Java code JSP, Struts, and JSF tags JavaScript Select the JSP file and click Debug As > Debug on Server from the context pop-up menu - The server automatically starts in debug mode The debugger stops at the breakpoint and displays the JSP Step through the JSP file, examine and change variable values Refresh the JSP in the Web browser to view changes made while debugging - - The state of the application is not lost, and the server recognizes your changes You do not need to republish to see JSP changes
  • 20. IBM AI - RAD What Is Remote Debugging?  The application to be debugged is on a different machine than the workstation running Rational Application Developer
  • 21. IBM AI - RAD Configuring a Remote Server for Debugging Turn on debug information - Window > Preferences > Java > Compiler Start the debugger using a remote launch configuration - Specify the connection properties
  • 22. IBM AI - RAD Step-By-Step Debugging: J2EE and Web Objects Works at a much higher level and stops on entry to every Web object loaded by the server Use the step-by-step mode to get to the Web object you want to debug - Then use traditional stepping to control debugging at the statement level Step into, step over, step return When entering a Web object, you decide whether to Skip or Step Into the object You can apply filters to further define which Web objects to automatically skip - Run/Debug > Java and Mixed Language Debug > Step Filters
  • 23. IBM AI - RAD Eclipse Test and Performance Tools Platform (TPTP) Open-source project for creating extensible testing, tracing, profiling, and monitoring tools on the Eclipse platform. Provides the following test suites: -TPTP JUnit Plug-in Test -TPTP JUnit Test -TPTP Manual Test -TPTP URL Test You can add a Test Case to an existing test suite Records HTTP Interactions using HTTP Recording -Can create a test suite from an existing recording Can create the following assets -Artifact -Datapool -Deployment -Location
  • 24. IBM AI - RAD Integrated Rational Agent Controller  In the past, you needed the services of the standalone Rational Agent Controller before they could test an application. - Even when you tried to test an application locally, including the local WebSphere Test Environment, the Rational Agent Controller would have to be installed on the local machine.  The Integrated Rational Agent Controller is a new feature in workbench that allows you to test an application locally without needing the standalone Rational Agent Controller on the local machine. - If you test on a remote machine, you still need the Rational Agent Controller on that remote machine. - There is no need to install and configure on a local copy of Rational Agent Controller when you are testing locally.
  • 25. IBM AI - RAD Steps to Create and Run Tests  Create a Test Project (Java Project) in the workspace. - A Test Project stores tests and results.  Create sub-folders to organize your code, for example: - tests folder for test suites assets folder for artifacts, deployments, and datapools  Can be further broken down into sub-folders for each asset type - results folder for test results  Create Test Suites and Test Cases. - - A Test Suite defines a scenario through a collection of test cases. A Test Case specifies what to do during the test.
  • 26. IBM AI - RAD Create a TPTP Test Suite 1.In Test Navigator, right-click your test project and select New  Test Element. 2.Choose one of the three indicated test suite types: a. b. c. TPTP JUnit Test suite definition to test Java classes. TPTP Manual Test suite to direct a user to perform steps and enter verdicts. TPTP URL Test suite to test Web applications. 3.Click Next.
  • 27. IBM AI - RAD Create a Test Project  Switch to the Test perspective - Window > Open Perspective > Other > Test You will need to select the Show All check box in the Open Perspective dialog, and then Confirm enablement.  From the main menu bar, select File > New > Project > Java Project. - Enter a Project name Click Next On the Java Settings page, click the Projects tab and add any projects that you will be testing classes in  For example, the LibraryTest project needs access to the classes in the LibraryUtility project so that test suites can see the classes - Click Finish  In the Test Navigator, add folders to organize the different test items you are going to create - Test Suites, test cases, recording, and artifacts
  • 28. IBM AI - RAD Create a TPTP JUnit Test (1 of 2) 1.Switch to the Test perspective. 2.From the Test Navigator view, bring up the popup menu and select New > Test Element > TPTP JUnit Test. 3.Click Next. 4.Select a Package and name the test suite. 5.Click Next.
  • 29. IBM AI - RAD Create a TPTP JUnit Test (2 of 2) 6.Specify the folder for the Test. 7.Click Finish.
  • 30. IBM AI - RAD TPTP JUnit Test Editor  Use the Test Methods tab to add methods to the underlying JUnit Test case.  Use the Behavior tab to add loops and invoke test methods. - The test methods can be from the underlying JUnit Test case, or from other Tests.
  • 31. IBM AI - RAD Editing the Underlying Test Case  In the Test Navigator, right-click the Test suite and select Open Source Code.  Add test code to the methods that you defined in the Test editor.  Save your changes.
  • 32. IBM AI - RAD Running the TPTP JUnit Test  In the Test Navigator, right-click the Test and select Run As > Test  Examine the results in the Test Log on the following page - - In the Test Navigator, double-click the execution Red X’s = failure
  • 33. IBM AI - RAD Test Log
  • 34. IBM AI - RAD Create a TPTP Manual Test 1.Switch to the Test perspective. 2.From the Test Navigator view, bring up the pop-up menu, right-click and select New >Test Element >TPTP Manual Test. 3.Click Next. 4.Select a folder and name the test suite. 5.Click Finish.
  • 35. IBM AI - RAD TPTP Manual Test Editor  Use the Test Cases tab to add Test case instructions.  Use the Behavior tab to add loops and invoke test methods. - The test methods can be from the underlying local Test, or from other Manual Tests.
  • 36. IBM AI - RAD Running the TPTP Manual Test  In the Test Navigator, right-click the Test and select Run As > Test.  The Manual Test View window opens. - Follow the instructions for each task. Enter detailed information.     - Verdict: Error, Fail, Inconclusive, or Pass Enter a text description Reason: None, See description, Success, Unknown, or User Intervention Attach any required files Click Next for the next task.
  • 37. IBM AI - RAD Manual Test View
  • 38. IBM AI - RAD Unit Test Web Application Components Steps to create a URL Test Case for Web applications: 1. Record HTTP request and response using the URL Recording Test Element. 2. Create a TPTP URL Test based on the HTTP request and response messages. 3. Customize the Test Cases by editing the HTTP request and response messages. 4. Generate an executable test based on the URL Test Suite. 5. Execute the test against the Web application. 6. Analyze the results from running the URL Test Case.
  • 39. IBM AI - RAD Record an URL Test Case 1. Switch to the Test perspective. 2. In Test Navigator view, right-click the test project and select New > Test Element > Recording > HTTP Recording. 3. Click Next. 4. When prompted, select a folder in the previously created Test project. 5. Provide an unique name for the new HTTP Recording and click Finish. 6. Wait for the Recorder Control to start the external Web browser.
  • 40. IBM AI - RAD Create URL Test Cases  Interact with your Web application through the external Web browser.  Either close the Web browser or click Stop Recording in the Recorder Control view.  A new Test Suite and a series of Test Cases are automatically created. - One Test Case appears for each HTTP request HTTP response messages are not captured  Open the URL Test Suite to customize the individual HTTP requests.
  • 41. IBM AI - RAD Customize URL Test Cases 1 2
  • 42. IBM AI - RAD Configure the Sequence of URL Test Cases 2 1
  • 43. IBM AI - RAD Generate an Executable URL Test  In the Test Navigator, right-click the TPTP URL Test Suite and select Generate.  At this point, you have a single Java class that executes a series of HTTP requests according to your settings in the URL Test Suite.
  • 44. IBM AI - RAD Run the URL Test and Examine the Result  In the Navigator view, right-click the URL Test and select Run > Run Test - Double-click the execution to examine the results
  • 45. IBM AI - RAD Create Graphical URL Test Reports  Right-click a URL Hyades Test Suite and select Report. - - - - Page Hit Rate measures the average number of hits per second for every URL resource Page Response Time measures the average number of seconds needed by the Web application to return a response Test Pass Report creates a report with presenting only the most recent execution results for each selected test within a specified period of time Time Frame Historic creates a report with presenting all of the executions run within a finite period of time
  • 46. IBM AI - RAD Checkpoint 1.In the middle of debugging a method, you decide you want to skip ahead to the point where control is handed back to the caller. What can you do? 2.What information is shown in the debug view? 3.How do you know that a breakpoint has some condition set? 4.On what lines of code are you able to enter a breakpoint? 5.A step filter is set for java.io.* and java.util.*. Would the same result be achieved by simply setting java.*? 6.What is step-by-step debugging?
  • 47. IBM AI - RAD Checkpoint answers 1.Click the Step return button, or press F7. 2.Stack frames, process threads, terminated launches. 3.There is a question mark overlay on the icon. 4.Executable lines. 5.Yes and no. It would certainly cover the two packages, but it would also cover all other java. Packages, and this may not be what is required. 6.Step-by-step debugging an application running on a Server will stop at entry to every object loaded by the JVM or server.
  • 48. IBM AI - RAD Checkpoint 1.What type of test do you create in order to unit test: a. b. c. A Java class? A JavaServer Page (JSP)? A Servlet? 2.How do you edit the test case of JUnit Test? 3.How do you check the test result for a Java class?
  • 49. IBM AI - RAD Checkpoint answers 1. a) TPTP JUnit Test, b) and c) TPTP URL Test 2.In the Navigator view, right-click on the Test and select Open Source Code. 3.In the Navigator view either • • Expand the test execution Double-click the test execution to view the Test Log
  • 50. IBM AI - RAD Lab  Debug Java application  Breakpoints and debug views  Step through code  Variables and examine views  Debug Web application  Start server in debug mode  Step-by-step debugging  Create a Test project  Create JUnit test cases  Run and analyse test cases
  • 51. IBM AI - RAD Grazie Hebrew Italian Gracias Russian Spanish Arabic Thank You Merci French German English Thai Korean Japanese Portuguese Danke Traditional Chinese Simplified Chinese Obrigado

Notas del editor

  1. Main Point: IBM is continuing to evolve and enhance the value that we bring to companies by building on the SOA announcements we made last fall…today we are going to talk to you about how a Business Centric Perspective to SOA is necessary to drive innovation that matters* As you know, SOA is one of IBM’s long term strategies to enable innovation that matters. IBM will continue to deliver SOA centric offerings. But we also want you to know that IBM’s view of SOA is business centric. and we’ll talk about this important concept. Further, we’ll discuss ways to get started through existing parts of your business (people process, information). Additionally, we’ll show how reuse and connectivity is critical to support the business centric approach. We’ll then give you detail on how the specific entry points are accelerated by SOA Foundation products and the business insight these products provide. Lastly, we’ll discuss an important part of the story called SOA Governance to ensure we’re aligning the business with IT.
  2. Notes:   Instructor notes: Purpose -- Informational slide giving the panorama of possibilities. Details -- Additional information -- Don't be tempted to explain each bullet! It would be sufficient to spend just a few moments here, long enough to show that the tool has wide capabilities for debugging. Mention that it is the first category that is the focus of the next 45 minutes, but that the principles covered will apply very largely to the other options. Transition statement -- Next: Debug View
  3. <number>
  4. <number>
  5. <number>
  6. <number> Statement filtering is a preference, controlled via Window > Preferences > Java > Debug > Step Filtering
  7. Notes: Not to be confused with Step Filters, which are used during step-by-step debugging of J2EE and Web Objects, and are discussed later in this course. Step Filters are specified in Window > Preferences > Run/Debug > Java and Mixed Language Debug > Step Filters. Instructor notes: Purpose -- Details -- Additional information -- Step filter: Filters that can be applied to normal debugging (step into/over/return). Step-by-step filtering: Filters applied to Web objects loaded by the server.   Make sure that students understand this distinction by the time you have presented slide 18 - there will be a checkpoint question on this! Transition statement -- Next: Configuring Step Filters
  8. Notes: Use the Step Filters with Shift-F5 also. Most filters blank out entire packages. The selected filter for a specific class. Filters are applied top-down, and the first match will be utilized. You can change the Step Filters by right-clicking in the Debug View and selecting Edit Step Filters. Note: Synthetic methods are methods that were created by the compiler and do not exist in the source code. Instructor notes: Purpose -- Details -- Additional information -- Transition statement -- Next: Debugging JavaServer Pages
  9. Notes: Java exception breakpoints suspend execution at the point where the exception is thrown. Execution can be suspended when an exception is uncaught, caught, or both. Most of the toolbar icons on the Breakpoints view are self explanatory. The Show Breakpoints Supported by Selected Target button deserves an explanation: Normally a list of all breakpoints (for all debug sessions) appears in the Breakpoints view, unless you use the filter by debug target action. To filter out breakpoints that are not related to the current debug session, click the Breakpoints view Show Breakpoints Supported by Selected Target button, or right-click in the view and enable the Show Supported Breakpoints pop-up menu item (this menu item is enabled when there is a check mark to the left of it). Instructor notes: Purpose -- Details -- Additional information -- The Java Exception breakpoint is the important teach point of this slide (make sure to go into Rational Application Developer to show this). Ask students why Exceptions should be singled out in this way. ANSWER: There may be no provision for some particular Exception, and therefore nowhere to put a breakpoint. It can be really useful to have execution suspended at the instant of the Exception being thrown in order to examine variable values. Transition statement -- Next: Adding a Breakpoint into a Web Application
  10. <number> Exceptions are a Java mechanism for handling errors, both expected and unexpected. We will talk about them at length in a later lecture.
  11. Notes: Instructor notes: Purpose -- Details -- Additional information -- Make sure that students understand that you would never want to have breakpoints lined up in this fashion in a debug session! This would be a good place to ask the question, `How many breakpoints do you need?'. ANSWER: There are a lot of different answers, of course. Some points to make are: It may be faster to step over lines to get to the code you want to examine rather than have two breakpoints separated by (say) 8 lines of code; Don't hesitate to move a breakpoint to a better location (closer to where a problem is occurring), but don't forget to remove or disable the original breakpoint. Transition statement -- Next: Configuring Breakpoint Properties
  12. Notes: The hit count must be a single positive integer. The condition can be complex, and might suspend execution several times. Any expression is valid as long as it evaluates to a boolean: Name.equals(employee.getName()) Double.compare(Math.random(), 0.5 == 1) thisTemperature != previousTemperature Execution suspends either when the condition is true or when the value changes. Instructor notes: Purpose -- Details -- Additional information -- The hit counter and conditions can be used together. Don't get into explanations about threads and VMs. Transition statement -- Next: The Variables View
  13. Notes: A visible variable is one that has been initialized. Notice that in the above code, execution is suspended on the line where resultString is created. The variable is not yet visible, so it is not in the Variables view. Stepping one line further will add it. Instructor notes: Purpose -- Details -- Additional information -- The lower half of this view is called the details pane. It will be seen in the next slide that it can divide the view horizontally or vertically, or hidden. Transition statement -- Next: Viewing and Changing Variables During Debugging
  14. Notes: Instructor notes: Purpose -- Details -- Additional information -- Java primitives are not mentioned. If any student asks, Here is the relevant dialog: // Screen capture of the “Primitive Type Display Options” dialog deleted Transition statement -- Next: Data in the Expressions View
  15. Notes: You can examine the values in this window. The window cannot be moved, and will only close when you either click in the editor or press Ctrl-Shift-i a second time. Instructor notes: Purpose -- Details -- Additional information -- Transition statement -- Next: Step Filtering
  16. <number>
  17. <number>
  18. Notes: When using WebSphere Application Server, you can save the generated .java files compiled from JSP files. Open the Deployment Descriptor for the Web application Click the Extensions tab In the JSP Attributes area, click Add to add the following key value pairs. name=keepgenerated value=true name=scratchdir value=C:/temp The generated files are stored in the location specified by the scratchdir property. Server-side JavaScript can be used as the scripting language in a JSP. The JavaScript debug adapter enables you to diagnose errors in JavaScript that is running locally or remotely on a WebSphere Application Server With the debug adapter, you can control the execution of your JavaScript by setting line breakpoints, stepping through your code, and examining the contents of variables Once you have launched a debug session you will need to do the following: Access the Web object by entering its URL in a browser. Use step-by-step debugging. Upon entering the Web object, step until a JavaScript stack is reached and the editor displays a JavaScript block, or set a breakpoint in your JavaScript and run until it is reached Some points to note when debugging JSPs: Step-by-step debug will not work well for JSPs that do not contain any executable code. Execution will halt at the top of the JSP, however there is nothing to "step" to. Run to line is not supported in JSPs. Setting JSP breakpoints may be slow. Allow extra time for the debugger to initialize if there are many JSP breakpoints. Breakpoint properties (such as hit count, condition, selected thread, and VM suspend policy) are not supported for JSP breakpoints. When you add a condition, the debugger will not stop at that breakpoint. You may need to publish the application to force the application server to pick up the breakpoints. Instructor notes: Purpose -- Details -- Additional information -- Draw students' attention to the points in the notes. They are all important. You might like to include them in the live presentation as well. Transition statement -- Next: What is Remote Debugging?
  19. Notes: The client/server design of the Java debugger allows you to launch a Java program from a computer on your network and debug it from the workstation running the platform. This is particularly useful when you are developing a program for a device that cannot host the development platform. It is also useful when you are debugging programs on dedicated machines such as Web servers. Instructor notes: Purpose -- Details -- Additional information -- Pass briefly over this slide and the next. The information is not important for this course. Transition statement -- Next: Configuring a Remote Server for Debugging
  20. Notes: Invoke the Java program on the remote computer using the appropriate VM arguments to specify debug mode and a communication port for the debugger. Instructor notes: Purpose -- Details -- Additional information -- For more information on remote debugging, see Rational Application Developer Help, under the topic Advanced options for debugging Java beans. Transition statement -- Next: Step-By-Step Debugging
  21. Notes: Step-by-step debugging an application running on a Server will stop at entry to every object loaded by the JVM or server, at which point you can step into or over and use other debugging features. Stepping into a method will open the debugger. When you skip a method, the Web object will run until the next Web object is reached, which you can step into or skip. If step-by-step filters are being applied, the debugger will stop at every Web object that is not filtered out. You can set step-by-step filters through the preferences. Web Objects include Servlets, JSPs, and EJBs. Instructor notes: Purpose -- Details -- Additional information -- Compare this with slide 14, Step Filtering. Make sure students understand the difference. Transition statement -- Next: Checkpoint Questions
  22. Notes: For more information about the testing tools provided by the Eclipse Test and Performance Tools Platform, visit the following site: http://www.eclipse.org/tptp/test/index.html Instructor notes: Purpose -- Details -- The Eclipse Test and Performance Tools Platform (TPTP) supports three types of testing environments: JUnit Plug-in test for unit testing plug-ins. JUnit test for unit testing Java applications. Manual test for unit tests that require human interaction. URL testing for unit testing Web resources, such as servlets and JSPs. Additional information -- Transition statement --
  23. Notes: Instructor notes: Purpose -- Provide details on the new Integrated Agent Controller in Application Developer 7. Details -- Additional information -- Transition statement --
  24. Notes: You do not need to explicitly create a test behavior (JUnit) Java class, as it is generated when you create a new Test. Later on, you can add Test Cases to the JUnit class. This will add a test method with the same name as the test case. Instructor notes: Purpose – Details – Additional information – Transition statement --
  25. Notes: This course does not cover creating a TPTP JUnit Plug-in Test, that is used to create Eclipse plug-in tests.
  26. Notes: Instructor notes: Purpose -- Details -- Additional information -- Transition statement --
  27. <number> In the Behavior list, the findByEmail test is from the PatronTest test suite.
  28. <number>
  29. <number>
  30. <number> You can submit bugs via the Bugzilla interface. Configure the Bugzilla URLs in Window > Preferences > Test > Test Log Viewer.
  31. <number>
  32. <number>
  33. <number> Note that, once it has finished, you can open the execution in the Test Log Editor.
  34. Notes:   Instructor notes: Purpose -- Details -- Additional information -- Transition statement --
  35. Notes: Instructor notes: Purpose -- Details -- Additional information -- Transition statement --
  36. Notes: Instructor notes: Purpose -- Details -- Additional information -- Transition statement --
  37. Notes: The Http Requests section lists all requests in the order that they were originally executed from the external Web browser. The Detailed Properties section allows you to modify the method, parameter, and body of the HTTP request. You can only set the request method to GET or POST HTTP method. Think Time specifies how long the test suite should wait before executing the next HTTP request. This value simulates how users take some time reading the current page before advancing to the next page. Instructor notes: Purpose -- Details -- Additional information -- Transition statement --
  38. Notes: The Behavior section specifies how many iterations to run each HTTP request in the sequence. The Detailed Properties section determines whether each HTTP request blocks for a response. The alternative is to run n iterations of the request one after another immediately. Instructor notes: Purpose -- Details -- Additional information -- Transition statement --
  39. Notes:   Instructor notes: Purpose -- Details -- Additional information -- Transition statement --
  40. Notes: This will run against a default local deployment. The exercise has you create a specific deployment.   Instructor notes: Purpose -- Details -- Additional information -- Transition statement --
  41. Notes:   Instructor notes: Purpose -- Details -- Additional information -- Transition statement -- [Unconditional]
  42. Notes: Write down your answers here: Instructor notes: Purpose — Details — Additional information — Transition statement —
  43. Notes: Write down your answers here: Instructor notes: Purpose — Details — Additional information — Transition statement —
  44. <number> RUP Rational Unified Process, Developer Tab, Designer > Concepts > J2EE to RUP Mapping Rational Unified Process, Developer Tab, Designer > Enterprise JavaBean (EJB) Design > Guidelines > Designing Enterprise JavaBeans (EJBs) Web Resources http://www-130.ibm.com/developerworks/ http://w3.ams1.ibm.com/services/ams/competency/ams/tools_support/rational/learn_about/ams_rational_advanced_learning.html EJB Best Practices: Entity Bean Protection: http://www-106.ibm.com/developerworks/java/library/j-ejb1008.html Literature Enterprise Java Programming with IBM® WebSphere®, Second Edition By Kyle Brown, Gary Craig, Greg Hester, Russell Stinehour, W. David Pitt, Mark Weitzel, Jim Amsden, Peter M. Jakab, Daniel Berg Additional Courses Introduction to Web Services - http://w3-3.ibm.com/education/CourseDescriptionServlet.wss?city=&state=&countrycode=&coursecode=XM371&courseDescrLanguageId=1 WebSphere Training and Technical enablement: http://www-128.ibm.com/developerworks/websphere/education/enablement/curriculum/cur_webtoolside.html
  45. <number> Self explanatory