Toad for Oracle’s CodeXpert: High-quality SQL & PL/SQL Code Validation

Slides:



Advertisements
Similar presentations
Copyright  Oracle Corporation, All rights reserved. 1 Creating an Application: The AppBuilder for Java IDE.
Advertisements

Module 17 Tracing Access to SQL Server 2008 R2. Module Overview Capturing Activity using SQL Server Profiler Improving Performance with the Database Engine.
Why Use Test Driven Development (TDD)?.  Why the need to change to TDD.  Talk about what TDD is.  Talk about the expectations of TDD.
SEP1 - 1 Introduction to Software Engineering Processes SWENET SEP1 Module Developed with support from the National Science Foundation.
Kanban Task Manager for Outlook ‒ Introduction
With TimeCard appointments are tagged with information that converts them into time sheets. This way users can report time and expenses from their Outlook.
Calendar Browser is a groupware used for booking all kinds of resources within an organization. Calendar Browser is installed on a file server and in a.
Building Enterprise Applications Using Visual Studio ®.NET Enterprise Architect.
1 Chapter 4 The Fundamentals of VBA, Macros, and Command Bars.
A Guide to Oracle9i1 Creating an Integrated Database Application Chapter 8.
1 Introduction to OBIEE: Learning to Access, Navigate, and Find Data in the SWIFT Data Warehouse Lesson 5: Navigation in OBIEE – Touring the Catalog Page.
Chapter 2: The Visual Studio.NET Development Environment Visual Basic.NET Programming: From Problem Analysis to Program Design.
Using ERWin to model your data Supplied by Computer Associates as part of AllFusion.
Chapter 24 - Quality Management 1Chapter 24 Quality management.
TIBCO Designer TIBCO BusinessWorks is a scalable, extensible, and easy to use integration platform that allows you to develop, deploy, and run integration.
® IBM Software Group © 2006 IBM Corporation JSF Tab Controls This Learning Module shows how to develop server-side EGL applications with dynamic content.
Microsoft Visual Basic 2005 CHAPTER 8 Using Procedures and Exception Handling.
CS527: (Advanced) Topics in Software Engineering Overview of Software Quality Assurance Tao Xie ©D. Marinov, T. Xie.
Chapter 4: Organizing and Manipulating the Data in Databases
Creating the Foundation for Enterprise Information Management.
University of Palestine software engineering department Testing of Software Systems Fundamentals of testing instructor: Tasneem Darwish.
Microsoft Visual Basic 2012 Using Procedures and Exception Handling CHAPTER SEVEN.
Using Windows Firewall and Windows Defender
Database Systems: Design, Implementation, and Management Eighth Edition Chapter 10 Database Performance Tuning and Query Optimization.
Programming with Microsoft Visual Basic 2012 Chapter 12: Web Applications.
Microsoft Excel 2007 © Wiley Publishing All Rights Reserved. The L Line The Express Line to Learning L Line.
Microsoft Visual Basic 2008 CHAPTER 8 Using Procedures and Exception Handling.
1 PHP and MySQL. 2 Topics  Querying Data with PHP  User-Driven Querying  Writing Data with PHP and MySQL PHP and MySQL.
ITEC224 Database Programming
Chapter 11: Introduction to the Visual Basic Environment Spreadsheet-Based Decision Support Systems Prof. Name Position (123) University.
CCS APPS CODE COVERAGE. CCS APPS Code Coverage Definition: –The amount of code within a program that is exercised Uses: –Important for discovering code.
Programming with Alice Computing Institute for K-12 Teachers Summer 2011 Workshop.
Automating Database Processing Chapter 6. Chapter Introduction Design and implement user-friendly menu – Called navigation form Macros – Automate repetitive.
Introduction to Arrays. definitions and things to consider… This presentation is designed to give a simple demonstration of array and object visualizations.
Software Engineering 2003 Jyrki Nummenmaa 1 SOFTWARE PRODUCT QUALITY Today: - Software quality - Quality Components - ”Good” software properties.
1 Copyright © 2004, Oracle. All rights reserved. Introduction to PL/SQL.
Chapter 2: SQL – The Basics Objectives: 1.The SQL execution environment 2.SELECT statement 3.SQL Developer & SQL*Plus.
University of Sunderland COM 220 Lecture Six Slide 1 Building Interactive Forms Applications using Oracle.
Oracle Data Integrator Procedures, Advanced Workflows.
OHTO -99 SOFTWARE ENGINEERING “SOFTWARE PRODUCT QUALITY” Today: - Software quality - Quality Components - ”Good” software properties.
CERN - IT Department CH-1211 Genève 23 Switzerland t DB Development Tools Benthic SQL Developer Application Express WLCG Service Reliability.
VistA Imaging Workstation Configuration. October The information in this documentation includes functionality of the software after the installation.
Introduction to Enterprise Guide Jennifer Schmidt Rhonda Ellis Cassandra Hall.
1 Copyright © 2004, Oracle. All rights reserved. Introduction to PL/SQL.
7 1 User-Defined Functions CGI/Perl Programming By Diane Zak.
The Software Development Process
3 Copyright © 2004, Oracle. All rights reserved. Working in the Forms Developer Environment.
Software Engineering 2004 Jyrki Nummenmaa 1 SOFTWARE PRODUCT QUALITY Today: - Software quality - Quality Components - ”Good” software properties.
Connecting with Computer Science2 Objectives Learn how software engineering is used to create applications Learn some of the different software engineering.
Software Engineering – University of Tampere, CS DepartmentJyrki Nummenmaa SOFTWARE PRODUCT QUALITY Today: - Software quality -
Topic 4 - Database Design Unit 1 – Database Analysis and Design Advanced Higher Information Systems St Kentigern’s Academy.
Oracle Data Integrator User Functions, Variables and Advanced Mappings
® IBM Software Group © 2009 IBM Corporation Essentials of Modeling with the IBM Rational Software Architect, V7.5 Module 15: Traceability and Static Analysis.
Copyright (c) 2003 by Prentice Hall Provided By: Qasim Al-ajmi Chapter 2 Introduction to Visual Basic Programming Visual Basic.NET.
Object-Oriented Application Development Using VB.NET 1 Chapter 2 The Visual Studio.NET Development Environment.
Visual Basic Integrated Development Environment (IDE) 56:150 Information System Design.
Banner 6.x Fundamentals: Navigation and Forms. n Name n Organization n Title/function n Job responsibilities n SCT Banner Experience n Expectations Introductions.
Chapter 2: The Visual Studio.NET Development Environment Visual Basic.NET Programming: From Problem Analysis to Program Design.
C Copyright © 2009, Oracle. All rights reserved. Using SQL Developer.
11 Copyright © 2009, Oracle. All rights reserved. Enhancing ETL Performance.
Building Enterprise Applications Using Visual Studio®
Chapter 2: The Visual Studio .NET Development Environment
QAD Browses.
Data Virtualization Tutorial: Introduction to SQL Script
Dynamic SQL: Writing Efficient Queries on the Fly
Introduction to Triggers
Dynamic SQL: Writing Efficient Queries on the Fly
Using JDeveloper.
DAT381 Team Development with SQL Server 2005
8 6 MySQL Special Topics A Guide to MySQL.
Presentation transcript:

Toad for Oracle’s CodeXpert: High-quality SQL & PL/SQL Code Validation Steven Feuerstein Bert Scalzo

Agenda Why should we use a Code Validation Process? What is Code Validation? Discussion of Code Validation Processes Demonstration of CodeXpert

Why Use a Code Validation Process? Software Defects are extremely costly We all agree: program liabilities must go! But how best to do this? "Manual" code review is necessary but not sufficient. It's hard to see them through consistently. Traditional quality-oriented tools for Developers are designed for Debugging Can be used as a Coding Coach Programmers can learn from the validation process and over time minimize the feedback loops from validation. Typical tools include debuggers and profilers. These tools are focused on correctness of the executing code There are many challenges with successfully performing code reviews, which may lead to organizations dropping this quality process step. Many development organizations do not even have a code review process

Why use a Code Validation Process? In 2002, National Annual cost of inadequate software testing cost up to $59.5 Billion Developers spend 40% of their time fixing software defects Between 60% and 70% of the cost of software is attributable to maintenance

What is Code Validation? Code Validation is not the same as a typical Code Review Components of Code Validation include... Efficiency Correctness Maintainability Readability Structure Complexity CRUD Matrix Code validation is much more than enforcing coding standards that regulate naming conventions or tab sets for indents Many organizations within the software industry have written and documented coding standards, but rarely implement them as standard development process. One of the reasons for this is that most people think of coding standards simply as naming conventions or code beautification, as opposed to a process for improving code quality.

Code Validation - Efficiency There are many aspects, small and large, to SQL & PL/SQL code efficiency Querying data from PL/SQL Dynamic SQL and Dynamic PL/SQL Loop Processing Using built-in functions in SQL Scalability of program

Code Validation - Correctness Syntactically correct code may not be functionally correct Transaction Management Variables and Data Structures Use of Built in Packages Scripts and SQL*Plus reports

Code Validation - Maintainability We spend 40% of our time fixing defects Up to 70% of the cost of software is attributable to Maintenance Is the intent of the code shown by the code itself? Transaction Management Querying Data Exception Processing

Code Validation - Readability Readability is where Code Reviews typically focus, but with smaller scope Coding style and conventions Program construction Loop Processing SELECT list items qualified

Code Validation - Structure Well-formed structure in PL/SQL helps avoid resource leaks and unexpected behavior Close those cursors! Variables and Data Structures Declaring and using Package Variables Global variable side effects can be especially problematic. Exception Processing SQL*Plus script options

Code Validation - Complexity Complex code is difficult to maintain High probability of introducing defects with changes due to maintenance Software Engineering Institute (SEI) and Capability Maturity Model (CMM) metrics : Number of Lines of Code Number of Statements Halstead Complexity – measure of module complexity McCabe's Cyclomatic Complexity – measure of soundness and confidence Maintainability Index – predictor of a module’s maintainability

Critical Success Factors Emphasize success, not failure Provide detailed analysis and solutions to code validation problems Avoid code violation “shock” with Prioritization Set measurable goals

CodeXpert – Where is it? Currently: SQL Editor Proc Editor Project Manager Upcoming Toad 9.0: File Menu Schema Browser Has its own screen

CodeXpert - Rule Filters Clicking on the filter down arrow lists the default rule filters. CodeXpert comes with predefined filters based on severity or review objectives

CodeXpert - Rule Details Summary Clicking on the rule sets icon displays the default rule sets and allows users to create their own filters. Note: user-defined filters are not the same as user-defined rule sets.

CodeXpert – Rules List Users and review all the rules in CodeXpert by clicking on the Rules tab. Rules are organized according to the drop-down selection.

CodeXpert – Analysis Options First button runs CodeXpert 2nd button enables/disables running CodeXpert rules 3rd button enables/disables scanning SQL statements for problematic SQL.

CodeXpert -- Result Set The Results tree will be displayed when the CodeXpert scan completes. Each objective is broken down into sub-categories and shows a count of the rules that failed. The Properties category displays a list of statistics about the code. This is comparable to the information available in the Formatter profile statistics.

CodeXpert – Flagged Rules in Result Set Clicking on a flagged rule highlights the code in the Editor.

CodeXpert – Flagged Rule Options Right-clicking on a flagged rule allows the user to see a detailed explanation of the rule and its purpose (Show Tip) User can also override, or ignore, a rule. A rule can be overridden completely or just a specific occurrence. Once a rule has been overridden, it can also be accepted back if the user changes their mind.

CodeXpert – Rule Insights Double-clicking on the rule description in the Result Summary or selecting the Show Tip option in the right-click menu displays insights for that rule.

CodeXpert – Report Summary Click on the full screen toggle to better show the full report The Report Summary is an excellent management tool or report to take to code review meetings. It summarizes the number of flagged and overridden rules, displays statistical analysis by severity and objective, as well as summarizations of CodeXpert’s complexity analysis.

CodeXpert – CRUD Matrix The CRUD Matrix displays a tabular representation of the data access for the SQL included in the scanned code.

CodeXpert – Code Metrics Report The Code Metrics Report: Based on the Software Engineering Institute (SEI) Capability Maturity Model (CMM) Displays a summary of industry standard, software complexity analysis reports Metrics reported include: Number of Statements Halstead Complexity Measure (Computational Complexity) McCabe’s Cyclomatic Complexity (soundness & confidence of code) SEI Maintainability Index (measurement reduce code entropy) Here we have a very short program with a relatively high level of complexity…

There’s real science behind all this 

Example of fixing complex code Before: Halstead = 160 Very convoluted logic Nearly impossible to read Maintenance nightmare!!! I’ve seen code like this  After: Halstead = 48 Equivalent end-result Much simpler logic Much easier to read Possible to maintain

CodeXpert – SQL Scan Answers the key developers’ question – so which SQL statements should I try to tune? CodeXpert SQL Scan auto-magically finds all the performance needles in the haystack! SQL Scan option is new with Toad8.5. Scans all SQL in code for problematic SQL. User can customize definition of problematic SQL by clicking on the customization toolbar option. Statements identified by SQL Scan can then be passed to Toad’s SQL Tuner for possible optimization (process shown in the next couple of slides).

Send Problematic SQL to Toad Xpert Tuning …

Let Toad Xpert Tuning Auto-Tune it for you …

Toad Xpert Tuning find lots of possible rewrites

Run them to find the winner …

Send the best SQL back to Toad …

The Toad Community More than 500,000 users Market-leading tool User groups and events Access to development team World-class support Toad is now available for SQL Server, DB2 and MySQL

Thank You for Attending Download a free evaluation of Toad for Oracle Download Toad Attend a Toad for Oracle Demo Toad for Oracle Events Learn how Toad for Oracle has helped organizations just like yours Customer Success Stories Thank You for Your Time!