Mock Objects in Functional Testing Sven Rosvall. Dimension Data Cloud Business Unit.

Slides:



Advertisements
Similar presentations
1 Symbian Client Server Architecture. 2 Client, who (a software module) needs service from service provider (another software module) Server, who provide.
Advertisements

MicroKernel Pattern Presented by Sahibzada Sami ud din Kashif Khurshid.
Exercises and Solutions Lecture 1
Importing and Calling Web Services from your CA Plex Applications Session Code: Lab13 Rob Layzell.
Sun-a, Kim Yoon kyoung, Kim. Samsung Smart TV SDK supports device convergence by allowing a client application running on an external device to communicate.
Executional Architecture
X stream Project proposal. Project goals: Students Students: Academic Supervisor Academic Supervisor: Advisors: Developing and Implementing a large scale.
Software Frame Simulator (SFS) Technion CS Computer Communications Lab (236340) in cooperation with ECI telecom Uri Ferri & Ynon Cohen January 2007.
Parasol Architecture A mild case of scary asynchronous system stuff.
Bentley Systems, Incorporated
SDL Proprietary and Confidential IMS Campaign Manager Campaign Design Workshop SDL Campaign Management Solutions.
Copyright 2004 Monash University IMS5401 Web-based Systems Development Topic 2: Elements of the Web (g) Interactivity.
1 Object-Oriented Software Development Project Aaron Christopher.
Technical Architectures
OpenJMS Presentation March 2000 © Copyright Exolab 2000.
I/O Hardware n Incredible variety of I/O devices n Common concepts: – Port – connection point to the computer – Bus (daisy chain or shared direct access)
Interpret Application Specifications
Performed by:Gidi Getter Svetlana Klinovsky Supervised by:Viktor Kulikov 08/03/2009.
Chapter 3.6 Game Architecture. 2 Overall Architecture The code for modern games is highly complex With code bases exceeding a million lines of code, a.
Advanced Distributed Software Architectures and Technology group ADSaT 1 Application Architectures Ian Gorton, Paul Greenfield.
Platform as a Service (PaaS)
Web Application Architecture: multi-tier (2-tier, 3-tier) & mvc
Christopher M. Pascucci Basic Structural Concepts of.NET Browser – Server Interaction.
Struts 2.0 an Overview ( )
UNIT-V The MVC architecture and Struts Framework.
TCP Sockets Reliable Communication. TCP As mentioned before, TCP sits on top of other layers (IP, hardware) and implements Reliability In-order delivery.
Object Oriented Databases by Adam Stevenson. Object Databases Became commercially popular in mid 1990’s Became commercially popular in mid 1990’s You.
© 2009 IBM Corporation 1 ClearQuest Synchronizer and ClearQuest Bridge Tech Enablement for CLM 4.0 Lorelei Ngooi & Yuhong Yin June 2012.
Applets & Servlets.
Programming Network Servers Topic 6, Chapters 21, 22 Network Programming Kansas State University at Salina.
Beyond DHTML So far we have seen and used: CGI programs (using Perl ) and SSI on server side Java Script, VB Script, CSS and DOM on client side. For some.
Database Design for DNN Developers Sebastian Leupold.
Fayoum University Faculty of Engineering Electrical Engineering Department E-voting system Using Smart Card Under the supervision Of: Dr. Magdy Amer.
SSC2: Web Services. Web Services Web Services offer interoperability using the web Web Services provide information on the operations they can perform.
Advanced Web Forms with Databases Programming Right from the Start with Visual Basic.NET 1/e 13.
11/16/2012ISC329 Isabelle Bichindaritz1 Web Database Application Development.
Capture-Replay Mocks Scandinavian Developer Conference 4 th April 2011 Geoff Bache.
第十四章 J2EE 入门 Introduction What is J2EE ?
4/2/03I-1 © 2001 T. Horton CS 494 Object-Oriented Analysis & Design Software Architecture and Design Readings: Ambler, Chap. 7 (Sections to start.
Ideas to Improve SharePoint Usage 4. What are these 4 Ideas? 1. 7 Steps to check SharePoint Health 2. Avoid common Deployment Mistakes 3. Analyze SharePoint.
Copyright, 1996 © Dale Carnegie & Associates, Inc. Presented by Hsiuling Hsieh Christine Liu.
Lecturer: Prof. Piero Fraternali, Teaching Assistant: Alessandro Bozzon, Advanced Web Technologies: Struts–
CS 8903 Demo Wireless Interface for the Bioloid Robot Chetna Kaur.
Presented by: SIF3 Framework Install - Java Joerg Huber Install & Verify Instructions and Exercise.
Internet Protocol B Bhupendra Ratha, Lecturer School of Library and Information Science Devi Ahilya University, Indore
1 Web Based Programming Section 8 James King 12 August 2003.
Christopher M. Pascucci Basic Structural Concepts of.NET Managing State & Scope.
Overview Web Session 3 Matakuliah: Web Database Tahun: 2008.
® IBM Software Group © 2007 IBM Corporation Best Practices for Session Management
Chapter 3.6 Game Architecture. 2 Overall Architecture The code for modern games is highly complex (can easily exceed 1M LOC) The larger your program,
CSI 3125, Preliminaries, page 1 SERVLET. CSI 3125, Preliminaries, page 2 SERVLET A servlet is a server-side software program, written in Java code, that.
Preface IIntroduction Objectives I-2 Course Overview I-3 1Oracle Application Development Framework Objectives 1-2 J2EE Platform 1-3 Benefits of the J2EE.
Copyright © The OWASP Foundation Permission is granted to copy, distribute and/or modify this document under the terms of the OWASP License. The OWASP.
Web Technologies Lecture 6 State preservation. Motivation How to keep user data while navigating on a website? – Authenticate only once – Store wish list.
Component Patterns – Architecture and Applications with EJB copyright © 2001, MATHEMA AG Component Patterns Architecture and Applications with EJB Markus.
FlowLevel Client, server & elements monitoring and controlling system Message Include End Dial Start.
Java Programming: Advanced Topics 1 Building Web Applications Chapter 13.
1 Chapter 22 World Wide Web (HTTP) Chapter 22 World Wide Web (HTTP) Mi-Jung Choi Dept. of Computer Science and Engineering
ASP.NET WEB Applications. ASP.NET  Web application framework developed by Microsoft  Build dynamic data driven web applications and web services  Subset.
R Some of these slides are from Prof Frank Lin SJSU. r Minor modifications are made. 1.
JQuery form submission CIS 136 Building Mobile Apps 1.
 Cloud Computing technology basics Platform Evolution Advantages  Microsoft Windows Azure technology basics Windows Azure – A Lap around the platform.
Coupling and Cohesion Schach, S, R. Object-Oriented and Classical Software Engineering. McGraw-Hill, 2002.
Platform as a Service (PaaS)
Platform as a Service (PaaS)
Some bits on how it works
Servlet API and Lifecycle
End-to-End REST Service Testing Automation
VOLTHA Lock-In January 10 & 11, 2018.
C6: Introducing Native Invocation with the OpenEdge® Adapter for Sonic™ ESB Chris James Senior Consultant.
Presentation transcript:

Mock Objects in Functional Testing Sven Rosvall

Dimension Data Cloud Business Unit

Testing Lifecycle

Unit Testing

Functional Testing

System Testing

Production

Test Responsibilities

Test Environments

Test Environment

Test Environments

Test in Production

Test Environments

Functional Testing Test Frame- work

Mocking Dependent Services Goals: Mimic required functionality for testing Easy to maintain and to deploy Verify requests Control expected responses Remove indirect dependencies

Modes of communication Synchronous Requests Asynchronous Messages Files Shared memory Database updates and triggers

Mocking an HTTP service Test Harness Mock Service Test Harness Mock Service Simple mock HTTP service Embedded HTTP service within test program

WireMock String responsePayload = fromFile("GetDeviceResponse_ok.json"); stubFor(get(urlEqualTo("/api/device?limit=100" + "&filter.component_unique_id=" + vmRefId + "&filter.component_root_device=" + vcenterDID)).withHeader("Authorization", equalTo("Basic " + new String(basicAuth, Charset.forName("UTF-8")))).willReturn(aResponse().withHeader("Content-Type", public WireMockRule wireMockRule = new WireMockRule(PORT);

Asynchronous Communication Test Harness

Proprietary Communication Protocol is hidden in a client library. Protocol is verbose and complex.

Solution: Mock Client Library Test Harness

Mock Client Library Use a back door connection for: Response data Inspecting request data Control exceptions Backdoor runs in its own thread. May require care when serializing data. Use same technology as is used for the service’s inputs.

Application state StatelessStateful State kept in some dependent service. State kept in application. No need to set up state before each test case. Run application functionality to set state correctly for each test. Run test cases in any order.or... Run tests in specific order to use state set in previous tests.

Database Usage Database stores state. Database as part of the application? Resetting content between tests. Mocking Database Access Layer

Database and Application “Database is a part of the application” “Database is a dependent service” ORM make database schema tightly coupled to the application. Database developed independently of application internal structures. Don’t let schema bleed into the test code. Test code is allowed full access to database

Database Preparation Use a golden image of database for quick start. May contain lots of static data. Recreate schema and data Recreate data only Roll-back data changed during test Prepare test specific data Tests that don’t update database

Inputs and outputs For a stateless service Identify input stimuli and the side effects they cause. Split each scenario to include one stimulus only.

Input Stimuli HTTP requests Messages Database triggers File creation

Minimize test scenario scopes

Questions