Automated Testing Options for PL/SQL Steven Feuerstein PL/SQL Evangelist, Quest Software www.quest.com steven.feuerstein@quest.com



Similar documents
Best Practices For PL/SQL Development in Oracle Application Express

Implementing Database Development Best Practices for Oracle

Making the Most of Oracle PL/SQL Error Management Features

Development Best Practices

Table of contents. Enterprise Resource Planning (ERP) functional testing best practices: Ten steps to ERP systems reliability

Guideline for stresstest Page 1 of 6. Stress test

Aspire's Approach to Test Automation

White Paper Performance Testing Methodology

A Practical Guide to Test Case Types in Java

The Importance of Defect Tracking in Software Development

Introduction site management software

The Importance of Continuous Integration for Quality Assurance Teams

Introduction to Automated Testing

Error Management in Oracle PL/SQL

Why Test Automation Fails

Testing Rails. by Josh Steiner. thoughtbot

Continuous Integration (CI) for Mobile Applications

Test Driven Development Part III: Continuous Integration Venkat Subramaniam

Test Run Analysis Interpretation (AI) Made Easy with OpenLoad

GUI Test Automation How-To Tips

Software Continuous Integration & Delivery

TIME MANAGEMENT FOR COLLEGE STUDENTS

Functional and LoadTest Strategies

Staffing Your Test Automation Team

The ROI of Test Automation

OPP ODTUG Kaleidoscope. An ODTUG SP* Oracle PL/SQL Programming Conference. WOW-Wide Open World, Wide Open Web!

Practicing Continuous Delivery using Hudson. Winston Prakash Oracle Corporation

Fail early, fail often, succeed sooner!

Basic Testing Concepts and Terminology

Realizing Continuous Performance Management

Case Study: Financial Institution Deploys MBT to Test at the Speed of Agile Development

Continuous integration End of the big bang integration era

Database Development Best Practices. Database Development Best Practices. Copyright 2006 Quest Software

Jenkins Continuous Build System. Jesse Bowes CSCI-5828 Spring 2012

Table of contents. Performance testing in Agile environments. Deliver quality software in less time. Business white paper

Upping the game. Improving your software development process

TESTING FRAMEWORKS. Gayatri Ghanakota

Outline. 1 Denitions. 2 Principles. 4 Implementation and Evaluation. 5 Debugging. 6 References

Testing Automation for Distributed Applications By Isabel Drost-Fromm, Software Engineer, Elastic

10 Best Practices for Application Performance Testing

Business white paper. Best practices for implementing automated functional testing solutions

How Silk Central brings flexibility to agile development

The Process Guidelines should be used in conjunction with the standard OUM process guidelines when using Testing and Quality Management Tools.

How To Measure Quality

Agile Testing Overview

Meta-Framework: A New Pattern for Test Automation

Continuous Integration: Improving Software Quality and Reducing Risk. Preetam Palwe Aftek Limited


Building, testing and deploying mobile apps with Jenkins & friends

1Targeting 2. 4Analysis. Introducing Marketing Automation. Best Practices for Financial Services and Insurance Organizations.

Web Application Security

Educational Collaborative Develops Big Data Solution with MongoDB

6b Continuing Past Exceptions

Custom Web Development Guidelines

Software testing. Objectives

Software Construction

Toad for Oracle tips & tricks

Automatic promotion and versioning with Oracle Data Integrator 12c

Increasing Business Efficiency and Agility for ATGbased. Systems. the business challenge: upgrading the development pipeline

Test Driven Development

A Guide To Evaluating a Bug Tracking System

An Oracle White Paper February Rapid Bottleneck Identification - A Better Way to do Load Testing

Ensuring Web Service Quality for Service-Oriented Architectures. An Oracle White Paper June 2008

Agile Testing: The Agile Test Automation Pyramid

Testing. Chapter. A Fresh Graduate s Guide to Software Development Tools and Technologies. CHAPTER AUTHORS Michael Atmadja Zhang Shuai Richard

Smarter Balanced Assessment Consortium. Recommendation

Continuous Integration

Achieving business benefits through automated software testing. By Dr. Mike Bartley, Founder and CEO, TVS

Activation of your SeKA account

Introduction to Testing Webservices

Key Benefits of Microsoft Visual Studio Team System

SPECIFICATION BY EXAMPLE. Gojko Adzic. How successful teams deliver the right software. MANNING Shelter Island

Implementing Continuous Integration Testing Prepared by:

Bullet Proof Your PL/SQL

Automated Integration Testing & Continuous Integration for webmethods

Rapid Bottleneck Identification A Better Way to do Load Testing. An Oracle White Paper June 2009

Best Practices for Dynamic SQL

Chapter 8 Software Testing


Exploratory Testing Dynamics

WHITE PAPER NOVEMBER Eliminate Software Development and Testing Constraints with Service Virtualization

TesT AuTomATion Best Practices

Database Management Solutions

Revolutionized DB2 Test Data Management

Relational Databases for the Business Analyst

Transcription:

Automated Testing Options for PL/SQL Steven Feuerstein PL/SQL Evangelist, Quest Software www.quest.com steven.feuerstein@quest.com Copyright 2008 Feuerstein and Associates

How to benefit most from this session Concentrate on concepts, not details. Afterwards... Download and use any of my the training materials, available at my "cyber home" on Toad World, a portal for Toad Users and PL/SQL developers: PL/SQL Obsession http://www.toadworld.com/sf Download and use any of my scripts (examples, performance scripts, reusable code) from the demo.zip, available from the same place. filename_from_demo_zip.sql You have my permission to use all these materials to do internal trainings and build your own applications. But they should not considered production ready. You must test them and modify them to fit your needs. Copyright 2008 Steven Feuerstein Page 1

What makes an application successful? Seems like we should know and it should be obvious...but is it? It must be CORRECT. Meet user requirements, be as free of bugs as possible. It must be FAST. If it is too slow, user frustration will doom the application. It must be MAINTAINABLE. Must be easy to understand and maintain. Otherwise, ROI on the application is reduced. Copyright 2008 Steven Feuerstein Page 2

How do we achieve CORRECT, FAST and MAINTAINABLE? CORRECT Only one way to verify correctness: test. Test the backend code, test the UI, test everything! FAST Identify performance bottlenecks (stress test) and then adjust the code as needed. MAINTAINABLE Follow coding standards and review code. Run regression tests, after every change, to verify that all programs still work. Copyright 2008 Steven Feuerstein Page 3

Lots of different kinds of tests Functional or application level testing Usually performed by QA and users Stress and performance testing Mostly a DBA job, but also for developers Unit (code) testing The responsibility of developers. Before we can say a program is finished, we (are supposed to) test it to prove that it works. But how responsible are we? Let's face it: very few of us adequately test our software. Copyright 2008 Steven Feuerstein Page 4

Why don't we test more thoroughly? Testing is hard, in any and every language. For thorough testing, you should expect to have to write at least 10 lines of test code for every line of application code that needs testing! Testing is boring. You are not creating code or writing interesting algorithms. Testing finds bugs (!). We don't really want to find bugs in our code. We have "gotten by" for years doing what we do. Copyright 2008 Steven Feuerstein Page 5

What's wrong with the way we test? We usually just "try" a few things. Testing is incomplete; mostly we are reassuring ourselves that the program is not obviously broken. We can't repeat our tests. We all too often do "throw away" testing, with the silent assumption that we will only have to do this once. We manually verify results. Takes way too much time and I can easily get it wrong. We start testing too late in the process. If I wait till I am "done" writing my program, I will run out of time. betwnstr.sf betwnstr.tst Copyright 2008 Steven Feuerstein Page 6

How can we improve our testing? Manual testing is a dead end. It will never offer more than "band-aid" testing. There is really only one practical solution: to automate code testing as fully as possible. Automation is key to... Practical, effective regression testing Giving us the time to test Increasing the coverage of tests Integrating testing into the development process. Copyright 2008 Steven Feuerstein Page 7

Options for automated testing of PL/SQL utplsql and its variants Open-source framework, part of the xunit family You must write the test code yourself. PL/Unit: a light version of utplsql PLUTO: an object type-based version of utplsql dbfit Based on the Fit platform, a tabular scripting approach, implemented in Java. Quest Code Tester for Oracle Robust, integrated test environment Commercial product Copyright 2008 Steven Feuerstein Page 8

About utplsql and its variants I built the original utplsql back in 1999 or so. I discovered Extreme Programming and its unit testing principle: "If testing is good, then everyone should test all the time." From there, I learned about Junit. It is a "cooperative paradigm." You "cooperate" by calling utassert programs to verify test results. utplsql "pays you back" by automatically running your test package and displaying the results. Unfortunately, you still must write the test code yourself. ut_betwnstr.pks ut_betwnstr.pkb Copyright 2008 Steven Feuerstein Page 9

More complete test automation with Quest Code Tester for Oracle Describe the tests you need through a graphical interface. Save your descriptions in a test repository, available for reporting and analysis. Generate the test code (a PL/SQL package) based on your descriptions. Run the test and view the red light, green light results. Let's build a test definition for the betwnstr function using Quest Code Tester. Copyright 2008 Steven Feuerstein Page 10

Integrating testing into development As long as we see testing as something we do after we are "done" writing our code, we are in serious trouble. We write our best code if we test as we proceed through development. 1. Make a change. 2. Run your test. 3. Verify that no bugs have been introduced. 4. Confirm that the new feature works as desired. Yeah, well, how can you do that? Copyright 2008 Steven Feuerstein Page 11

You prepare for each new program Hold off on writing the cool and challenging algorithms. First take four steps: 1 Validate Requirements 2 3 Define Construct Expected Header Behavior 4 Build Test Code Confirm what you are supposed to build, then identify assumptions Think about the interface, not the implementation How will it be used? In other words, how will you know when you have finished the program? Establish a baseline before you write the code, then compile it against stub. Yes! Think about testing before coding. Copyright 2008 Steven Feuerstein Page 12

Crafting successful applications through automated testing Stop separating development from testing. They are two sides of the same coin. Rely on a predefined, standard testing framework that automates as much of the work as possible. Automated testing with a framework allows you to... Help you stay focused on critical, required functionality. Greatly reduce the number of bugs. Produce a regression test suite that makes safe evolution and maintenance possible. Copyright 2008 Steven Feuerstein Page 13