Gallio: Crafting a Toolchain. Jeff Brown jeff.brown@gmail.com



Similar documents
This section provides a 'Quickstart' guide to using TestDriven.NET any version of Microsoft Visual Studio.NET

Two-Way Data Binding with WinJS By Marcin Kawalerowicz and Craig Berntson, authors of Continuous Integration in.net

The Complete.NET Developer Productivity Pack


Improving software quality with an automated build process

Programming with the Microsoft.NET Framework Using Microsoft Visual Studio 2005 (VB)

YouTrack MPS case study

IBM WebSphere ILOG Rules for.net

Engine: Using MSBuild and Team Foundation

SOFTWARE TESTING TRAINING COURSES CONTENTS


SQL Server Integration Services. Design Patterns. Andy Leonard. Matt Masson Tim Mitchell. Jessica M. Moss. Michelle Ufford

Programmabilty. Programmability in Microsoft Dynamics AX Microsoft Dynamics AX White Paper

Embedded Software Development with MPS

Continuous Integration with CruiseControl.Net

Service Governance and Virtualization For SOA

Meister Going Beyond Maven

Developing Algo Trading Applications with SmartQuant Framework The Getting Started Guide SmartQuant Ltd Dr. Anton B.

zen Platform technical white paper

DataDirect XQuery Technical Overview

Xcode Project Management Guide. (Legacy)

We ( have extensive experience in enterprise and system architectures, system engineering, project management, and

Hardwarekrav. 30 MB. Memory: 1 GB. Additional software Microsoft.NET Framework 4.0.

Upgrading a Visual Basic Application to.net:

Eliminate Memory Errors and Improve Program Stability

Jitterbit Technical Overview : Salesforce

Agile.NET Development Test-driven Development using NUnit

BUSINESS RULES CONCEPTS... 2 BUSINESS RULE ENGINE ARCHITECTURE By using the RETE Algorithm Benefits of RETE Algorithm...

Reporting Services. White Paper. Published: August 2007 Updated: July 2008

Dynamic website development using the Grails Platform. Joshua Davis Senior Architect Cognizant Technology Solutions

Database Application Developer Tools Using Static Analysis and Dynamic Profiling

Introducing Apache Pivot. Greg Brown, Todd Volkert 6/10/2010

Code Quality Assurance. Peter Kofler, Code Cop FH Technikum Wien, February 2010

Extending XSLT with Java and C#

> Define the different phases of K2 development, including: understand, model, build, maintain and extend

ASP &.NET. Microsoft's Solution for Dynamic Web Development. Mohammad Ali Choudhry Milad Armeen Husain Zeerapurwala Campbell Ma Seul Kee Yoon

My DevOps Journey by Billy Foss, Engineering Services Architect, CA Technologies

Debugging Java Applications

METADATA-DRIVEN QLIKVIEW APPLICATIONS AND POWERFUL DATA INTEGRATION WITH QLIKVIEW EXPRESSOR

An Eclipse Plug-In for Visualizing Java Code Dependencies on Relational Databases

Enhanced Project Management for Embedded C/C++ Programming using Software Components

Talend Open Studio for ESB. Release Notes 5.2.1

Jitterbit Technical Overview : Microsoft Dynamics CRM

Continuous Integration

Continuous Integration

Application Development,.NET

Authoring for System Center 2012 Operations Manager

Continuous. Integration. in.net MARGIN KAWALEROWICZ CRAIG BERNTSON MANNING. Greenwich. (74 w. long.)

ArcGIS Viewer for Silverlight An Introduction

FORMS & WORKFLOW SHAREPOINT Practical Discussion

Programming Fundamentals of Web Applications Course 10958A; 5 Days

Desktop, Web and Mobile Testing Tutorials

LoadRunner and Performance Center v11.52 Technical Awareness Webinar Training

Bug hunting. Vulnerability finding methods in Windows 32 environments compared. FX of Phenoelit

Leveraging Rational Team Concert's build capabilities for Continuous Integration

Demo: Controlling.NET Windows Forms from a Java Application. Version 7.3

CATALOG OF CLASSES IT and Technical Courses

Integrating TAU With Eclipse: A Performance Analysis System in an Integrated Development Environment

Apache Sling A REST-based Web Application Framework Carsten Ziegeler cziegeler@apache.org ApacheCon NA 2014

Functional UI testing of Adobe Flex RIA. Viktor Gamov August,

CrossPlatform ASP.NET with Mono. Daniel López Ridruejo

Terms and Definitions for CMS Administrators, Architects, and Developers

Application Testing Suite: A fully Java-based software testing platform for testing Oracle E-Business Suite and other web applications

TeamCity A Professional Solution for Delivering Quality Software, on Time

mframe Software Development Platform KEY FEATURES

InstallAware for Windows Installer, Native Code, and DRM

Objectif. Participant. Prérequis. Remarque. Programme. C# 3.0 Programming in the.net Framework. 1. Introduction to the.

Introducing Micro Focus Net Express to Develop and Extend COBOL Applications within.net White Paper

Visual Basic. murach's TRAINING & REFERENCE

Java (12 Weeks) Introduction to Java Programming Language

Braindumps.C questions

FreeForm Designer. Phone: Fax: POB 8792, Natanya, Israel Document2

Communiqué 4. Standardized Global Content Management. Designed for World s Leading Enterprises. Industry Leading Products & Platform

Content Management Systems: Drupal Vs Jahia

SW5706 Application deployment problems

Software Development Kit

Software Automated Testing

To install Multifront you need to have familiarity with Internet Information Services (IIS), Microsoft.NET Framework and SQL Server 2008.

Getting Started with the Ed-Fi ODS and Ed-Fi ODS API

Introducing the.net Framework 4.0

XpoLog Center Suite Data Sheet

WHITE PAPER. Peter Drucker. intentsoft.com 2014, Intentional Software Corporation

Agile Business Suite: a 4GL environment for.net developers DEVELOPMENT, MAINTENANCE AND DEPLOYMENT OF LARGE, COMPLEX BACK-OFFICE APPLICATIONS

MOVING THE CLINICAL ANALYTICAL ENVIRONMENT INTO THE CLOUD

Developing a Web Server Platform with SAPI Support for AJAX RPC using JSON

Getting Started with Telerik Data Access. Contents

JavaScript Testing. Beginner's Guide. Liang Yuxian Eugene. Test and debug JavaScript the easy way PUBLISHING MUMBAI BIRMINGHAM. k I I.

Internships and graduation jobs Development

Architecture Rules Enforcement and Governance Using Aspects

Documentum Developer Program

EVALUATION ONLY. WA2088 WebSphere Application Server 8.5 Administration on Windows. Student Labs. Web Age Solutions Inc.

Web Development with the Eclipse Platform

Transcription:

Gallio: Crafting a Toolchain Jeff Brown jeff.brown@gmail.com

About Me Jeff Brown Lead Software Engineer at Yellowpages.com Creator of Gallio Open Source Project Lead of MbUnit Open Source Project Coding is fun!

Outline Gallio and MbUnit Demo What is a Toolchain? Implementation Challenges Under the Hood Roadmap Questions

Gallio Gallio is a neutral test automation platform. Open Source. (Apache License) Microsoft.Net platform. Aims to provide great tools integration for many different test frameworks. Started in October 2007 as a spinoff from MbUnit. Current release: v3.0.5. Website: www.gallio.org

Gallio Vision: Gallio will be the foundation for a rich suite of interoperable tools. Test frameworks. Test runners. Test case managers. Test generators. Test reports and analytics. Test editors and IDE integration. Continuous integration facilities.

Gallio Lingua franca for test tools. Common object model. Support for many different workflows. Extensible. Evolving. Owned by the community. Objective: To unite, not to control.

Gallio Tools support Frameworks: CSUnit, MbUnit v2, MbUnit v3, MSTest, NBehave, NUnit, xunit.net Runners: GUI (Icarus), Command-line (Echo), TestDriven.Net, ReSharper, Visual Studio Test Tools, MSBuild, NAnt, PowerShell. Other: CruiseControl.Net, TeamCity, TypeMock, NCover, Pex, AutoCAD 3 rd party Contributions: DXCore runner (RedGreen), MSpec, and more

Gallio Trivia Original code name provided by Andrew Stopford was to be Galileo but it was corrupted to Gallio due to a misspelling in an early email thread.

MbUnit MbUnit is a test automation framework. Open Source. (Apache License) Aims to provide a powerful framework for unit testing and integration testing for.net. Started by Jonathan Peli de Halleux in 2004. Complete rewrite for MbUnit v3 in 2007/2008. Current release: MbUnit v3.0.5. Website: www.mbunit.com

MbUnit MbUnit is mostly NUnit compatible but improves on it in many ways: Focus on usability and clear reporting. Data-driven testing. (eg. [Row]-test, pairwise and combinatorial testing) Supports unit testing and integration testing. Easily extensible by creating new attributes. Dynamic test structure.

MbUnit Trivia: Original name was GUnit but that name turned out to already be taken. Model based Unit Testing Framework. Or if you prefer Much better Unit Testing Framework. ;-)

Gallio and MbUnit Demo

What is a Toolchain? A collection of tools that work together. Did you notice how many different interactions there were between tools in the demo? A lot.

Implementation Challenges Test code is hostile! By definition, subject under test may contain bugs. Could kill the test process due to stack overflows, out of memory, and other side-effects. Test code must be isolated. Run in separate process, ideally. Run in separate AppDomain, at a minimum. Be prepared to abort the test run.

Implementation Challenges Test frameworks define tests differently. xunit.net: A fixture is just a.net class, a test is just a.net method. NUnit: Tests are declared statically using metadata in a.net assembly. MbUnit: Tests are declared statically but datadriven test instances are generated dynamically. RSpec: Tests are generated dynamically when a test script is evaluated.

Implementation Challenges Test frameworks define tests differently Some use XML. Some use databases. Some use collections of standalone programs. Some generate tests on-the-fly from a model. etc... Test representation must be flexible. Test platform must not be opinionated though it must support frameworks that are.

Implementation Challenges Test frameworks make assumptions Working directory contains test assembly. Application base directory is same as working directory. Can resolve references to test assembly dependencies. If a test assembly has an associated configuration file, it is loaded. x86-only tests run in x86 mode on x64. Full trust security model.

Implementation Challenges Extensibility model mismatches. ReSharper wants plugins to be installed in C:\Program Files\JetBrains\ReSharper\... Visual Studio Test Tools must be able to load custom test types from GAC or from Visual Studio Private Assemblies. TestDriven.Net can load a test framework assembly from anywhere but it might not be able to resolve the references of that assembly.

Implementation Challenges Test platform must be prepared to establish its own private hosting environment regardless of how it is loaded by 3 rd party tools.

Implementation Challenges Test hosts make assumptions Everything is running in a single process (for debuggers and code profilers). Test code does not have lasting side effects upon the host. Test structure: Dynamic metadata rich hierarchy (Gallio) Static hierarchy rooted at project (ReSharper) Static flat list (Visual Studio) Ignored and not reported in results (TestDriven.net)

Under the Hood

Under the Hood: Test Model At test exploration time... All we have is static metadata. Some data may not be available. Might not be able to execute code. Create a ITest Tree to describe exploration. At test execution time We have all the information. Create a ITestStep Tree to describe execution.

Under the Hood: Test Model Tests have: Unique stable identifier. Name. Metadata. Kind: Namespace, Fixture, Suite, Test, etc Description. Documentation. Arbitrary key/value pairs. Children. Dependencies. Ordering. Parameters.

Under the Hood: Test Model Caveats: We might define new tests at runtime. Tests might have dynamic substructure eg. Instances of parameterized tests. Test runners cannot assume static and dynamic test structure are the same (but many do..)

Under the Hood: Test Log Want to report test results uniformly. Simple document format. Primitives: Streams (Containers) Failures, Warnings, Console Output, etc... Sections (Delimiters) Markers (Embedded Metadata) Diffs, Links, Highlights, Stack Traces Text Attachments

Under the Hood: Reflection Tests can be explored before compilation! JetBrains ReSharper unit test runner Abstract reflection layer Native.Net reflection wrappers. ReSharper Code Model wrappers. (x2) Visual Studio Code Model wrappers. Cecil wrappers. Enables test explorer to be polymorphic.

Under the Hood: Reflection Abstract Reflection API IReflectionPolicy ICodeElementInfo IAssemblyInfo, IAttributeInfo, IConstructorInfo, IEventInfo, IFieldInfo, IGenericParameterInfo, IMemberInfo, IMethodInfo, INamespaceInfo, IParameterInfo, ITypeInfo CodeLocation, CodeReference Access to Xml documentation comments. Unexpected bonus: Uniformity IFunctionInfo: constructor or method. ISlotInfo: field, property, parameter, or generic parameter.

Under the Hood: Pattern Test Framework Reflection-based frameworks are common. Demand for different syntaxes: BDD, etc Typical solution: Syntax adapters: wrap another test framework. Better solution: Reuse code test exploration strategy. Define completely custom syntax. Better user experience and branding potential.

Under the Hood: Pattern Test Framework IPattern Basic compositional unit of structure in a test. Abstract syntax Three basic methods: IsPrimary: Does this pattern declare something new? Consume: If this pattern is primary, produce something new from a given code element. Process: Enrich something else created by another pattern using a given code element.

Under the Hood: Pattern Test Framework [PatternAttribute] Associates a pattern with a code element. Most MbUnit v3 attributes are Pattern Attributes. You can make a custom framework the same way.

Under the Hood: Pattern Test Framework MbUnit v3 Examples: [Test]: Primary pattern that creates a new tests. [SetUp]: Primary pattern that registers the associated method in the setup chain of the containing fixture. [Description]: Secondary pattern that adds descriptive metadata to a test or fixture. [Row]: Secondary pattern that adds a new data source to a test or fixture.

Under the Hood: Pattern Test Framework Might help you write a new test framework Reflection-based test exploration. General-purpose test execution engine. Data binding. etc... Or forget all of this and build it from scratch Just implement ITestFramework, ITestExplorer, and ITestController to explore and execute tests.

Lessons Learned Beware of hidden assumptions. All test hosts are a little different. Protect the test frameworks and tools from unanticipated variations in hosting. Version independence is mandatory.

Lessons Learned Consolidation of the tool chain is very useful. This is a lot harder than it looks! If you plan to write your own test framework, consider using Gallio as the underlying platform.

Roadmap v3.0: First spike. Self-host. Integrate with many different environments. Challenge assumptions. Gain experience. v3.1: Generalize and consolidate. Support non-.net languages and workflows. Simplify extensibility contracts. Performance.

Gallio Futures Gallio is the nucleus of a growing suite of interoperable test tools. Ambience: A database for persistent test data. Archimedes: An automation test case manager including distributed test agent and test data warehouse. Dynamic languages, scripting languages, test DSLs and non.net frameworks in v3.1.

MbUnit Futures More built-in assertions. Provide mixins to assist with integration of 3 rd party libraries such as Rhino.Mocks, Selenium and WatiN. ASP.Net hosting..net Framework 4.0 extensions.

Ongoing and Upcoming Projects Gallio Book Mono Support Test Case Manager (Archimedes) Test Data Warehouse Distributed Test Runner Modeling Language for Integration Tests

Volunteers Wanted! What do you want to do? Build your own stuff using Gallio. Add new stuff to Gallio itself. Promote Gallio. Offer feedback and suggestions. Help us write the Gallio Book.

Questions?