Download presentation
Presentation is loading. Please wait.
Published bySydney Hubbard Modified over 9 years ago
1
Royal London Group A group of specialist businesses where the bottom line is always financial sense Get your Oracle app Fit for release Malcolm Leckie Technical Designer Scottish Life – part of The Royal London Group 1
2
Agenda Introduction 2 What is Fit How Royal London use Fit Questions ?
3
UK’s largest mutual (customer-owned) Life and Pensions provider Multi-brand business run as separate business units 3,040 * employees, primarily UK-based with main offices in Edinburgh, Wilmslow and London £52.2 billion * of funds under management Around 3.6 million customers * About Royal London * As at 31 st March 2013 3
4
About Scottish Life Founded in 1881, acquired by Royal London in 2001 Pension specialist Internal business users on two UK sites Core business applications primarily developed in-house including secure web application for external customers and business partners 4
5
About Me First started using Oracle on Unix in 1987 Been with Scottish Life since 1990 and didn’t start using Oracle again until 2004 Work within the Technical Architecture & Design team Provide specialised technical support for Scottish Life Oracle development teams covering both database and code 5
6
About the Database Main policy administration application uses Oracle 11r1 database and PL/SQL for business logic Complex application landscape with multiple integrations One production database supporting OLTP during day time and batch during night time – c. 1k concurrent users per hour – c. 1m online transactions per day – c. 350 batch reports per night Multiple concurrent batch streams with complex dependencies 6
7
About the Applications 7 Windows Web Servers DMZ Internet Internal Network Unix Database Servers Oracle Windows Database Servers MS SQL Windows Application Servers External Users (Financial Advisers, Employers, Employees/ Policyholders) External Business Partners Internal Users Firewall
8
Royal London Group A group of specialist businesses where the bottom line is always financial sense Why am I here? Moment of madness in February Not to preach why to test To show you how to reduce time spent on regression testing High level overview of the solution we have in place 8
9
Royal London Group A group of specialist businesses where the bottom line is always financial sense What business issues were we facing Desire to Improve speed and ease of regression testing Increase collaborative design and testing Reduce impact on code quality and confidence due to late requirements 9
10
Royal London Group A group of specialist businesses where the bottom line is always financial sense In the beginning Development of new application in Java Trying to using an Agile approach Unit testing and test driven development Fit framework for testing – opportunities for PLSQL 10
11
Royal London Group A group of specialist businesses where the bottom line is always financial sense What is Fit? Framework for Integrated Test, or "Fit", is an open-source tool for automated customer tests. It integrates the work of customers, analysts, testers, and developers. Fit was invented by Ward Cunningham in 2002. 11
12
Royal London Group A group of specialist businesses where the bottom line is always financial sense 12 Core Java Fixtures Components HTML Output HTML Input User Java Fixtures Input and expected results Interface to the application Results
13
Royal London Group A group of specialist businesses where the bottom line is always financial sense Where is the code – Java Fixtures? Download from sourceforge Get a single zip file 13
14
Royal London Group A group of specialist businesses where the bottom line is always financial sense Fit for Java v1.1 : fit-java-1.1.zip Archive Contents In this archive, you will find the following files and directories: fit.jar: The Fit executable and library. license.txt: The Fit license. Fit is licensed under the GPL. readme.html: This file. examples/input/: Sample files that you can run through Fit. examples/output/: What a few sample files look like after they've been run through Fit. examples/eg/: The source code for some example fixtures. spec/input/: The Fit Specification. spec/output/: The Fit Specification after being run on this release. spec/source/: Source code for the fixtures used in the Fit Specification. doc/: Supporting documentation. There's not much here—see the Fit website for the real Fit documentation. source/: The source tree used to build this release. 14
15
Royal London Group A group of specialist businesses where the bottom line is always financial sense HTML Driver File 15 Integer Arithmetic Basic Arithmetic eg.ArithmeticFixture x y + - * / 4 2 6 2 8 1
16
Royal London Group A group of specialist businesses where the bottom line is always financial sense HTML Driver File 16. Integer Arithmetic Basic Arithmetic eg.ArithmeticFixture x y + - * / 4 2 6 2 8 1 Test Body
17
Royal London Group A group of specialist businesses where the bottom line is always financial sense HTML Driver File 17 Integer Arithmetic Integer Arithmetic Basic Arithmetic eg.ArithmeticFixture x y + - * / 4 2 6 2 8 1 Group Header
18
Royal London Group A group of specialist businesses where the bottom line is always financial sense HTML Driver File 18 Basic Arithmetic eg.ArithmeticFixture. Integer Arithmetic Basic Arithmetic eg.ArithmeticFixture x y + - * / 4 2 6 2 8 1 Test Header and fixture
19
Royal London Group A group of specialist businesses where the bottom line is always financial sense HTML Driver File 19 x y + - * / Integer Arithmetic Basic Arithmetic eg.ArithmeticFixture x y + - * / 4 2 6 2 8 1 Parameter Headers
20
Royal London Group A group of specialist businesses where the bottom line is always financial sense HTML Driver File 20 4 2 6 2 8 1 Integer Arithmetic Basic Arithmetic eg.ArithmeticFixture x y + - * / 4 2 6 2 8 1 Parameters
21
Royal London Group A group of specialist businesses where the bottom line is always financial sense HTML Driver File 21
22
Royal London Group A group of specialist businesses where the bottom line is always financial sense Java Fixture 22 package eg; import fit.*; public class ArithmeticFixture extends PrimitiveFixture { int x=0; int y=0; public void doRows(Parse rows) { super.doRows(rows.more); // skip column heads } public void doCell(Parse cell, int column) { switch (column) { case 0: x = (int)parseLong(cell); break; case 1: y = (int)parseLong(cell); break; case 2: check(cell, x+y); break; case 3: check(cell, x-y); break; case 4: check(cell, x*y); break; case 5: check(cell, x/y); break; default: ignore(cell); break; }
23
Royal London Group A group of specialist businesses where the bottom line is always financial sense Easy to run To use Fit on your own project use the following command-line: java -classpath fit.jar fit.FileRunner input.html output.html e.g. java -classpath fit.jar fit.FileRunner JavaArith.html results.html You'll see this message: 3 right, 1 wrong, 0 ignored, 0 exceptions 23
24
Royal London Group A group of specialist businesses where the bottom line is always financial sense Test Output 24
25
Royal London Group A group of specialist businesses where the bottom line is always financial sense 25 Exceptions Wrong Right Parameters Output
26
Royal London Group A group of specialist businesses where the bottom line is always financial sense User Friendly? Command line – is not Need a GUI or something similar FitNesse – Wiki based Jdeveloper Eclipse 26
27
Royal London Group A group of specialist businesses where the bottom line is always financial sense 27 HTML Driver HTML Output Java Fixture Results Explorer view of tests/results HTML Editor
28
Royal London Group A group of specialist businesses where the bottom line is always financial sense 28 HTML viewer
29
Royal London Group A group of specialist businesses where the bottom line is always financial sense 29 Java Editor
30
Royal London Group A group of specialist businesses where the bottom line is always financial sense Other Enhancements 30 Interact with Oracle Call procedures/functions (standalone or in packages) Scalar parameters Ref Cursors Run a folder at a time (groups of tests) Easy to use Flexible environment MI
31
Royal London Group A group of specialist businesses where the bottom line is always financial sense Interact with Oracle “Out of the box” framework doesn’t support non-java calls DBFit can connect to various databases Extended with own code to provide a flexible solution 31
32
Royal London Group A group of specialist businesses where the bottom line is always financial sense HTML Driver File 32 fixtures.PackageTester Test pck_sample1 Test Case l call procedure fit_sample1.p_call_1 Iterations IN Output OUT 1 Hello World fixtures.PackageTester call procedure fit_sample1.p_call_1
33
Royal London Group A group of specialist businesses where the bottom line is always financial sense PLSQL Fixture 33 CREATE OR REPLACE PACKAGE BODY fit_sample1 IS PROCEDURE p_call_1(pn_number IN NUMBER,pv_output OUT VARCHAR2,pv_success OUT VARCHAR2) IS BEGIN pv_success := 'FAILED'; pck_sample1.p_call_1(pn_number => pn_number,pv_output => pv_output); pv_success := 'PASSED'; END p_call_1; END fit_sample1; RL definition of a fixture: Acts as a conduit from the test to the application Handles parameter translation Provides a “success” indicator
34
Royal London Group A group of specialist businesses where the bottom line is always financial sense Ref Cursors - definition 34 call function fit_table.f_get_data with ref cursor return ref_cursor_col1 ref_cursor_col2 ref_cursor_col3 Success OUT PASSED Function to call Note extra instruction Columns in the ref cursor Normal parameters fixtures.PackageTester Test Ref Cursor Fetch Test Case l..
35
Royal London Group A group of specialist businesses where the bottom line is always financial sense Ref Cursors - definition 35 ref cursor output ref_cursor_col1 ref_cursor_col2 ref_cursor_col3 ROW1 1 12 Mar 2008 ROW2 2 13 Mar 2008 ROW3 4 14 Mar 2008 fixtures.PackageTester Test Ref Cursor Fetch Test Case l.. Cursor definition 1 row in the table per row expected
36
Royal London Group A group of specialist businesses where the bottom line is always financial sense Ref Cursors – plsql 36 FUNCTION f_get_data(pv_success OUT VARCHAR2) RETURN SYS_REFCURSOR IS lcu_cursor SYS_REFCURSOR; BEGIN OPEN lcu_cursor FOR 'SELECT ref_cursor_col1,ref_cursor_col2,ref_cursor_col3 FROM datatest ORDER BY ref_cursor_col1 DESC'; pv_success := 'PASSED'; RETURN lcu_cursor; EXCEPTION WHEN OTHERS THEN pv_success := SQLERRM; END f_get_data; INSERT INTO datatest (ref_cursor_col1,ref_cursor_col2,ref_cursor_col3) VALUES ('ROW1','1','12 MARCH 2008'); INSERT INTO datatest (ref_cursor_col1,ref_cursor_col2,ref_cursor_col3) VALUES ('ROW2','2','13 MARCH 2008'); INSERT INTO datatest (ref_cursor_col1,ref_cursor_col2,ref_cursor_col3) VALUES ('ROW3','4','14 MARCH 2008'); Data
37
Royal London Group A group of specialist businesses where the bottom line is always financial sense Ref Cursor Data 37 SELECT ref_cursor_col1,ref_cursor_col2,ref_cursor_col3 FROM datatest ORDER BY ref_cursor_col1 DESC; REF_CURSOR_COL1REF_CURSOR_COL2REF_CURSOR_COL3 ROW3414/03/2008 ROW2213/03/2008 ROW1112/03/2008
38
Royal London Group A group of specialist businesses where the bottom line is always financial sense Ref Cursor Output 38 Note the order of the data – it is in the order we specified in the test NOT the order that PLSQL returned
39
Royal London Group A group of specialist businesses where the bottom line is always financial sense Other Enhancements 39 Interact with Oracle Call packages and functions Scalar parameters Ref Cursors Run a folder at a time Easy to use Flexible environment MI
40
Royal London Group A group of specialist businesses where the bottom line is always financial sense Run a folder at a time 40 Picks up tests for folder Runs them one at a time Reports results for each test and a summary for the folder
41
Royal London Group A group of specialist businesses where the bottom line is always financial sense Run a folder at a time 41 Scripts in folderTests
42
Royal London Group A group of specialist businesses where the bottom line is always financial sense Other Enhancements 42 Interact with Oracle Call packages and functions Scalar parameters Ref Cursors Run a folder at a time Easy to use Flexible environment MI
43
Royal London Group A group of specialist businesses where the bottom line is always financial sense Easy to Use 43 Testers write the test scripts (in HTML) or generate test scripts using Excel This makes cloning the script for different scenarios as simple as keying the input data and expected results into the spreadsheet Agreement on approach up front Testing primarily done by test and business analysts Programmers write the fixtures in PLSQL Test data centrally stored, is easily cloned and altered. Template driven test script
44
Royal London Group A group of specialist businesses where the bottom line is always financial sense Test Script Flow 44 Delete data Load in test data This ensures a script is testing what we want, we have to empty any data from previous scripts Prepare the start-point of the test we are running Run code In the case of functions, we can do these in one. Some tests will require that we run something, then display the results afterwards Check results
45
Royal London Group A group of specialist businesses where the bottom line is always financial sense Other Enhancements 45 Interact with Oracle Call packages and functions Scalar parameters Ref Cursors Run a folder at a time Easy to use Flexible environment MI
46
Royal London Group A group of specialist businesses where the bottom line is always financial sense Flexible environment 46 Two distinct types of clients 1.Developers & Projects 2.Automatic “continuous” Environment needs to be easy built and maintained Need to consider code and data Easily built Self contained
47
Royal London Group A group of specialist businesses where the bottom line is always financial sense Developer/Project Environment 47 HTML Output HTML Scripts Schema Build Process schema Datastore
48
Royal London Group A group of specialist businesses where the bottom line is always financial sense Automatic “continuous” Environment 48 HTML Output HTML Scripts Schema Update Process Datastore schema
49
Royal London Group A group of specialist businesses where the bottom line is always financial sense Automatic “continuous” Environment Maintained as part of the normal shipping process Schema set up matches production Locked down Runs different suites of tests Centrally reported Managed by Test Hub 49
50
Royal London Group A group of specialist businesses where the bottom line is always financial sense Datastore Contains two types of data Static business data Policy/Scheme test data Repository of data to allow repeatable tests Can be updated/cloned to meet testing needs 50
51
Royal London Group A group of specialist businesses where the bottom line is always financial sense Other Enhancements 51 Interact with Oracle Call packages and functions Scalar parameters Ref Cursors Run a folder at a time Easy to use Flexible environment MI
52
Royal London Group A group of specialist businesses where the bottom line is always financial sense MI 52
53
Royal London Group A group of specialist businesses where the bottom line is always financial sense MI 53
54
Royal London Group A group of specialist businesses where the bottom line is always financial sense What has Fit done for us? Reduced production failures – caught them early Made regression testing easier Lessens risk of late changes Testers and developers working together Provide a large reusable regression suite 54
55
Royal London Group A group of specialist businesses where the bottom line is always financial sense What has Fit done for us? Current test count - c8600 Run approx 1200 scripts a night (6000 at a weekend) Equates to 350,000 checks per night (1,100,000 at a weekend) All new PLSQL code must have a corresponding Fit suite 55
56
Royal London Group A group of specialist businesses where the bottom line is always financial sense Summary Fit is easy to use and provides lots of opportunities Geared towards test/business users Framework can be easily extended to do what you need The software is free – even the Eclipse GUI Provided business benefits with improved quality Large reusable regression suite 56
57
Royal London Group A group of specialist businesses where the bottom line is always financial sense Any questions? Malcolm Leckie mleckie@scottishlife.co.uk
58
Royal London Group A group of specialist businesses where the bottom line is always financial sense URLs Fit : http://en.wikipedia.org/wiki/Framework_for_Integrated_Testhttp://en.wikipedia.org/wiki/Framework_for_Integrated_Test Fit Download : http://sourceforge.net/projects/fit/files/fit-java/1.1http://sourceforge.net/projects/fit/files/fit-java/1.1 FitNesse : http://www.fitnesse.org/FrontPagehttp://www.fitnesse.org/FrontPage Jdeveloper : http://www.oracle.com/technetwork/developer-tools/jdev/overview/index.htmlhttp://www.oracle.com/technetwork/developer-tools/jdev/overview/index.html Eclipse : http://www.eclipse.org/platformhttp://www.eclipse.org/platform DBFit : http://sourceforge.net/projects/dbfithttp://sourceforge.net/projects/dbfit
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.