The document discusses challenges with cross-platform testing of a content management system used at the BBC that runs on both Windows and Unix. It describes using tools like Test::MockObject and Test::MockModule to mock platform-specific functions and GUI components to allow Unix tests to run on Windows. Automating tests on multiple platforms and writing tests in a platform-agnostic way from the start are recommended to improve test coverage across operating systems.
This is the support of a course to teach mainly Redux, and Redux with React for Java and C# programmers. It is the third part of the course to recycle programmers from desktop app programming to web app programming. This course covers from history of Redux, its origin, step by step what is a reducer, and later concepts like reducer splitting, action handling, async and many more.
You also can use repositories:
- https://github.com/drpicox/learn-redux-bytesting
- https://github.com/drpicox/learn-redux-zoo-bytesting
To improve your skills.
A simple talk about appliyng patterns in Javascript.
It focuses in both jQuery and Angular.
It explains some basics MVC, cohesion and coupling.
It also have many examples of the patterns applied.
Full examples and documentation can be found here: http://david-rodenas.com/tutorial-jspatterns-v1/
Introduction
Spring Boot testing features
Example of microservices with Spring Cloud
Component & Integration testing with Hoverfly
Contract testing with Pact or Spring Cloud Contract
Load testing with Gatling
Integration & end-to-end testing with Arquillian Cube
Summary
This is the support of a course to teach mainly Redux, and Redux with React for Java and C# programmers. It is the third part of the course to recycle programmers from desktop app programming to web app programming. This course covers from history of Redux, its origin, step by step what is a reducer, and later concepts like reducer splitting, action handling, async and many more.
You also can use repositories:
- https://github.com/drpicox/learn-redux-bytesting
- https://github.com/drpicox/learn-redux-zoo-bytesting
To improve your skills.
A simple talk about appliyng patterns in Javascript.
It focuses in both jQuery and Angular.
It explains some basics MVC, cohesion and coupling.
It also have many examples of the patterns applied.
Full examples and documentation can be found here: http://david-rodenas.com/tutorial-jspatterns-v1/
Introduction
Spring Boot testing features
Example of microservices with Spring Cloud
Component & Integration testing with Hoverfly
Contract testing with Pact or Spring Cloud Contract
Load testing with Gatling
Integration & end-to-end testing with Arquillian Cube
Summary
Custom deployments with sbt-native-packagerGaryCoady
sbt-native-packager offers a comprehensive approach to packaging artifacts with SBT. The user describes a generic layout, which can then be extended for different types of software and deployments. For example, it is flexible enough to describe both a Zip-based archive format, and an RPM package with appropriate Systemd configuration for a service.
This talk will cover the essentials needed to understand the design of sbt-native-packager, and how to extend its structure to create custom layouts and deployments.
GeeCON 2017 - TestContainers. Integration testing without the hassleAnton Arhipov
TestContainers is a Java library that supports JUnit tests, providing lightweight, throwaway instances of common databases, Selenium web browsers, or anything else that can run in a Docker container.
An introduction on testing Node.js code.
Covers frontend (UI) testing, backend unit tests and code coverage.
Also mentions how to use a Makefile to run frontend and backend tests at the same time.
«Objective-C Runtime в примерах» — Алексей Сторожев, e-Legione-Legion
Цель доклада — вдохновить разработчиков на более глубокое изучение возможностей Objective-C Runtime, показать способы исследования системы, воодушевить аудиторию на эксперименты.
В докладе показаны несколько примеров использования Objective-C Runtime для решения нетипичных задач. Первый пример - реализация простого KVO своими руками тремя способами. Вторым примером показана полезность исследования приватных классов. Рассказано, как во время работы программы получить информацию о протянутых IBOutlet и IBAction в xib и storyboard. В каждом примере присутствуют особенности реализации, на которых сделан акцент и показаны варианты решения или обхода.
Understanding bytecode and what bytecode is likely to be generated by a Java compiler helps the Java programmer in the same way that knowledge of assembler helps the C or C++ programmer. Java bytecode is the form of instructions that Java virtual machine executes. This knowledge is crucial when debugging and doing performance and memory usage tuning. The presenter will share his knowledge on what bytecode means for your platform and how to create compiler while using some awesome tools.
JavaFX 8 est disponible depuis mars 2014 et apporte son lot de nouveautés. Gradle est en version 2 depuis juillet 2014. Deux technologies plus que prometteuses: JavaFX donne un coup de jeune au développement d’applications desktop en Java en apportant un navigateur web intégré, le support des WebSockets, de la 3D, et bien d’autres. Gradle est l’outil de d’automatisation de build à la mode, apportant de superbes possibilités par rapport rapport à maven, outil vieillissant, grâce à l’engouement de la communauté vis à vis de cet outil mais aussi par le fait de la technologie utilisée en son sein: groovy. Venez découvrir comment il est possible de réaliser rapidement une application à la mode en JavaFX avec un outil à la mode également. Bref venez à une session trendy.
REX about JavaFX8 used in SlideshowFX. This presentation covers concept from JavaFX as well as technologies like OSGi, Vert.x, LeapMotion, nashorn and friends in order to make them communicate inside one application developed in JavaFX.
This presentation was made at the ElsassJUG
Custom deployments with sbt-native-packagerGaryCoady
sbt-native-packager offers a comprehensive approach to packaging artifacts with SBT. The user describes a generic layout, which can then be extended for different types of software and deployments. For example, it is flexible enough to describe both a Zip-based archive format, and an RPM package with appropriate Systemd configuration for a service.
This talk will cover the essentials needed to understand the design of sbt-native-packager, and how to extend its structure to create custom layouts and deployments.
GeeCON 2017 - TestContainers. Integration testing without the hassleAnton Arhipov
TestContainers is a Java library that supports JUnit tests, providing lightweight, throwaway instances of common databases, Selenium web browsers, or anything else that can run in a Docker container.
An introduction on testing Node.js code.
Covers frontend (UI) testing, backend unit tests and code coverage.
Also mentions how to use a Makefile to run frontend and backend tests at the same time.
«Objective-C Runtime в примерах» — Алексей Сторожев, e-Legione-Legion
Цель доклада — вдохновить разработчиков на более глубокое изучение возможностей Objective-C Runtime, показать способы исследования системы, воодушевить аудиторию на эксперименты.
В докладе показаны несколько примеров использования Objective-C Runtime для решения нетипичных задач. Первый пример - реализация простого KVO своими руками тремя способами. Вторым примером показана полезность исследования приватных классов. Рассказано, как во время работы программы получить информацию о протянутых IBOutlet и IBAction в xib и storyboard. В каждом примере присутствуют особенности реализации, на которых сделан акцент и показаны варианты решения или обхода.
Understanding bytecode and what bytecode is likely to be generated by a Java compiler helps the Java programmer in the same way that knowledge of assembler helps the C or C++ programmer. Java bytecode is the form of instructions that Java virtual machine executes. This knowledge is crucial when debugging and doing performance and memory usage tuning. The presenter will share his knowledge on what bytecode means for your platform and how to create compiler while using some awesome tools.
JavaFX 8 est disponible depuis mars 2014 et apporte son lot de nouveautés. Gradle est en version 2 depuis juillet 2014. Deux technologies plus que prometteuses: JavaFX donne un coup de jeune au développement d’applications desktop en Java en apportant un navigateur web intégré, le support des WebSockets, de la 3D, et bien d’autres. Gradle est l’outil de d’automatisation de build à la mode, apportant de superbes possibilités par rapport rapport à maven, outil vieillissant, grâce à l’engouement de la communauté vis à vis de cet outil mais aussi par le fait de la technologie utilisée en son sein: groovy. Venez découvrir comment il est possible de réaliser rapidement une application à la mode en JavaFX avec un outil à la mode également. Bref venez à une session trendy.
REX about JavaFX8 used in SlideshowFX. This presentation covers concept from JavaFX as well as technologies like OSGi, Vert.x, LeapMotion, nashorn and friends in order to make them communicate inside one application developed in JavaFX.
This presentation was made at the ElsassJUG
Step by step introduction to get unit testing, UI testing, mocking and continuous integration up and running for your Swift projects. These slides are from Agile Swift Meetup in Montreal.
Through the magic of virtualization technology (Vagrant) and Puppet, a companion Enterprise grade provisioning technology, we explore how to make the complex configuration game a walk in the park. Bring new team members up to speed in minutes, eliminate variances in configurations, and make integration issues a thing of the past.
Welcome to the new age of team development!
Integration testing is hard, and often teams are tempted to do it in production. Testcontainers allows writing meaningful integration tests spawning Docker containers for databases, queue systems, kv-store, other services. The talk, a blend of slides and live code, will show how we are able to deploy without fear while integrating with a dozen of different datastores. Don't mock your database with fake data anymore, work with real data
Ansible is an open source automation platform, written in Python, that can be used for configuration-management, application deployment, cloud provisioning, ad-hoc task-execution, multinode orchestration and so on. This talk is an introduction to Ansible for beginners, including tips like how to use containers to mimic multiple machines while iteratively automating some tasks or testing.
Burn down the silos! Helping dev and ops gel on high availability websitesLindsay Holmwood
HA websites are where the rubber meets the road - at 200km/h. Traditional separation of dev and ops just doesn't cut it.
Everything is related to everything. Code relies on performant and resilient infrastructure, but highly performant infrastructure will only get a poorly written application so far. Worse still, root cause analysis in HA sites will more often than not identify problems that don't clearly belong to either devs or ops.
The two options are collaborate or die.
This talk will introduce 3 core principles for improving collaboration between operations and development teams: consistency, repeatability, and visibility. These principles will be investigated with real world case studies and associated technologies audience members can start using now. In particular, there will be a focus on:
- fast provisioning of test environments with configuration management
- reliable and repeatable automated deployments
- application and infrastructure visibility with statistics collection, logging, and visualisation
Infrastructure-as-code: bridging the gap between Devs and OpsMykyta Protsenko
Ops are overwhelmed with support. Devs are mad because their cannot deploy the changes as fast as they want. Sounds familiar?
Infrastructure-as-code can make your life easier by empowering developers and reducing operations' routine toil. It can cut down the lead time for infrastructure provisioning from hours or even days to minutes.
This talk reviews several IaC tools and approaches, showing how to integrate them into continuous delivery pipeline. It covers the problems and challenges that engineers may face while working with infrastructure-as-code tools and provides a few hands-on recipes to address them.
Mathilde Lemée & Romain Maton
La théorie, c’est bien, la pratique … aussi !
Venez nous rejoindre pour découvrir les profondeurs de Node.js !
Nous nous servirons d’un exemple pratique pour vous permettre d’avoir une premiere experience complete autour de Node.js et de vous permettre de vous forger un avis sur ce serveur Javascript qui fait parler de lui !
http://soft-shake.ch/2011/conference/sessions/incubator/2011/09/01/hands-on-nodejs.html
This talk represents the combined experience from several web development teams who have been using Symfony2 since months already to create high profile production applications. The aim is to give the audience real world advice on how to best leverage Symfony2, the current rough spots and how to work around them. Aside from covering how to implement functionality in Symfony2, this talk will also cover topics such as how to best integrate 3rd party bundles and where to find them as well as how to deploy the code and integrate into the entire server setup.
Singletons in PHP - Why they are bad and how you can eliminate them from your...go_oh
While Singletons have become a Pattern-Non-Grata over the years, you still find it surprisingly often in PHP applications and frameworks. This talk will explain what the Singleton pattern is, how it works in PHP and why you should avoid it in your application.
Introduction to Nightwatch.js artifacts, usage in a CI environment, and current integration with Drupal 8.
Video of session: https://www.youtube.com/watch?v=9GYZJ1AZqI8
In the rapidly evolving landscape of technologies, XML continues to play a vital role in structuring, storing, and transporting data across diverse systems. The recent advancements in artificial intelligence (AI) present new methodologies for enhancing XML development workflows, introducing efficiency, automation, and intelligent capabilities. This presentation will outline the scope and perspective of utilizing AI in XML development. The potential benefits and the possible pitfalls will be highlighted, providing a balanced view of the subject.
We will explore the capabilities of AI in understanding XML markup languages and autonomously creating structured XML content. Additionally, we will examine the capacity of AI to enrich plain text with appropriate XML markup. Practical examples and methodological guidelines will be provided to elucidate how AI can be effectively prompted to interpret and generate accurate XML markup.
Further emphasis will be placed on the role of AI in developing XSLT, or schemas such as XSD and Schematron. We will address the techniques and strategies adopted to create prompts for generating code, explaining code, or refactoring the code, and the results achieved.
The discussion will extend to how AI can be used to transform XML content. In particular, the focus will be on the use of AI XPath extension functions in XSLT, Schematron, Schematron Quick Fixes, or for XML content refactoring.
The presentation aims to deliver a comprehensive overview of AI usage in XML development, providing attendees with the necessary knowledge to make informed decisions. Whether you’re at the early stages of adopting AI or considering integrating it in advanced XML development, this presentation will cover all levels of expertise.
By highlighting the potential advantages and challenges of integrating AI with XML development tools and languages, the presentation seeks to inspire thoughtful conversation around the future of XML development. We’ll not only delve into the technical aspects of AI-powered XML development but also discuss practical implications and possible future directions.
GraphRAG is All You need? LLM & Knowledge GraphGuy Korland
Guy Korland, CEO and Co-founder of FalkorDB, will review two articles on the integration of language models with knowledge graphs.
1. Unifying Large Language Models and Knowledge Graphs: A Roadmap.
https://arxiv.org/abs/2306.08302
2. Microsoft Research's GraphRAG paper and a review paper on various uses of knowledge graphs:
https://www.microsoft.com/en-us/research/blog/graphrag-unlocking-llm-discovery-on-narrative-private-data/
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Albert Hoitingh
In this session I delve into the encryption technology used in Microsoft 365 and Microsoft Purview. Including the concepts of Customer Key and Double Key Encryption.
Epistemic Interaction - tuning interfaces to provide information for AI supportAlan Dix
Paper presented at SYNERGY workshop at AVI 2024, Genoa, Italy. 3rd June 2024
https://alandix.com/academic/papers/synergy2024-epistemic/
As machine learning integrates deeper into human-computer interactions, the concept of epistemic interaction emerges, aiming to refine these interactions to enhance system adaptability. This approach encourages minor, intentional adjustments in user behaviour to enrich the data available for system learning. This paper introduces epistemic interaction within the context of human-system communication, illustrating how deliberate interaction design can improve system understanding and adaptation. Through concrete examples, we demonstrate the potential of epistemic interaction to significantly advance human-computer interaction by leveraging intuitive human communication strategies to inform system design and functionality, offering a novel pathway for enriching user-system engagements.
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!SOFTTECHHUB
As the digital landscape continually evolves, operating systems play a critical role in shaping user experiences and productivity. The launch of Nitrux Linux 3.5.0 marks a significant milestone, offering a robust alternative to traditional systems such as Windows 11. This article delves into the essence of Nitrux Linux 3.5.0, exploring its unique features, advantages, and how it stands as a compelling choice for both casual users and tech enthusiasts.
Climate Impact of Software Testing at Nordic Testing DaysKari Kakkonen
My slides at Nordic Testing Days 6.6.2024
Climate impact / sustainability of software testing discussed on the talk. ICT and testing must carry their part of global responsibility to help with the climat warming. We can minimize the carbon footprint but we can also have a carbon handprint, a positive impact on the climate. Quality characteristics can be added with sustainability, and then measured continuously. Test environments can be used less, and in smaller scale and on demand. Test techniques can be used in optimizing or minimizing number of tests. Test automation can be used to speed up testing.
How to Get CNIC Information System with Paksim Ga.pptxdanishmna97
Pakdata Cf is a groundbreaking system designed to streamline and facilitate access to CNIC information. This innovative platform leverages advanced technology to provide users with efficient and secure access to their CNIC details.
In his public lecture, Christian Timmerer provides insights into the fascinating history of video streaming, starting from its humble beginnings before YouTube to the groundbreaking technologies that now dominate platforms like Netflix and ORF ON. Timmerer also presents provocative contributions of his own that have significantly influenced the industry. He concludes by looking at future challenges and invites the audience to join in a discussion.
Unlocking Productivity: Leveraging the Potential of Copilot in Microsoft 365, a presentation by Christoforos Vlachos, Senior Solutions Manager – Modern Workplace, Uni Systems
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AIVladimir Iglovikov, Ph.D.
Presented by Vladimir Iglovikov:
- https://www.linkedin.com/in/iglovikov/
- https://x.com/viglovikov
- https://www.instagram.com/ternaus/
This presentation delves into the journey of Albumentations.ai, a highly successful open-source library for data augmentation.
Created out of a necessity for superior performance in Kaggle competitions, Albumentations has grown to become a widely used tool among data scientists and machine learning practitioners.
This case study covers various aspects, including:
People: The contributors and community that have supported Albumentations.
Metrics: The success indicators such as downloads, daily active users, GitHub stars, and financial contributions.
Challenges: The hurdles in monetizing open-source projects and measuring user engagement.
Development Practices: Best practices for creating, maintaining, and scaling open-source libraries, including code hygiene, CI/CD, and fast iteration.
Community Building: Strategies for making adoption easy, iterating quickly, and fostering a vibrant, engaged community.
Marketing: Both online and offline marketing tactics, focusing on real, impactful interactions and collaborations.
Mental Health: Maintaining balance and not feeling pressured by user demands.
Key insights include the importance of automation, making the adoption process seamless, and leveraging offline interactions for marketing. The presentation also emphasizes the need for continuous small improvements and building a friendly, inclusive community that contributes to the project's growth.
Vladimir Iglovikov brings his extensive experience as a Kaggle Grandmaster, ex-Staff ML Engineer at Lyft, sharing valuable lessons and practical advice for anyone looking to enhance the adoption of their open-source projects.
Explore more about Albumentations and join the community at:
GitHub: https://github.com/albumentations-team/albumentations
Website: https://albumentations.ai/
LinkedIn: https://www.linkedin.com/company/100504475
Twitter: https://x.com/albumentations
Essentials of Automations: The Art of Triggers and Actions in FMESafe Software
In this second installment of our Essentials of Automations webinar series, we’ll explore the landscape of triggers and actions, guiding you through the nuances of authoring and adapting workspaces for seamless automations. Gain an understanding of the full spectrum of triggers and actions available in FME, empowering you to enhance your workspaces for efficient automation.
We’ll kick things off by showcasing the most commonly used event-based triggers, introducing you to various automation workflows like manual triggers, schedules, directory watchers, and more. Plus, see how these elements play out in real scenarios.
Whether you’re tweaking your current setup or building from the ground up, this session will arm you with the tools and insights needed to transform your FME usage into a powerhouse of productivity. Join us to discover effective strategies that simplify complex processes, enhancing your productivity and transforming your data management practices with FME. Let’s turn complexity into clarity and make your workspaces work wonders!
Maruthi Prithivirajan, Head of ASEAN & IN Solution Architecture, Neo4j
Get an inside look at the latest Neo4j innovations that enable relationship-driven intelligence at scale. Learn more about the newest cloud integrations and product enhancements that make Neo4j an essential choice for developers building apps with interconnected data and generative AI.
Threats to mobile devices are more prevalent and increasing in scope and complexity. Users of mobile devices desire to take full advantage of the features
available on those devices, but many of the features provide convenience and capability but sacrifice security. This best practices guide outlines steps the users can take to better protect personal devices and information.
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...James Anderson
Effective Application Security in Software Delivery lifecycle using Deployment Firewall and DBOM
The modern software delivery process (or the CI/CD process) includes many tools, distributed teams, open-source code, and cloud platforms. Constant focus on speed to release software to market, along with the traditional slow and manual security checks has caused gaps in continuous security as an important piece in the software supply chain. Today organizations feel more susceptible to external and internal cyber threats due to the vast attack surface in their applications supply chain and the lack of end-to-end governance and risk management.
The software team must secure its software delivery process to avoid vulnerability and security breaches. This needs to be achieved with existing tool chains and without extensive rework of the delivery processes. This talk will present strategies and techniques for providing visibility into the true risk of the existing vulnerabilities, preventing the introduction of security issues in the software, resolving vulnerabilities in production environments quickly, and capturing the deployment bill of materials (DBOM).
Speakers:
Bob Boule
Robert Boule is a technology enthusiast with PASSION for technology and making things work along with a knack for helping others understand how things work. He comes with around 20 years of solution engineering experience in application security, software continuous delivery, and SaaS platforms. He is known for his dynamic presentations in CI/CD and application security integrated in software delivery lifecycle.
Gopinath Rebala
Gopinath Rebala is the CTO of OpsMx, where he has overall responsibility for the machine learning and data processing architectures for Secure Software Delivery. Gopi also has a strong connection with our customers, leading design and architecture for strategic implementations. Gopi is a frequent speaker and well-known leader in continuous delivery and integrating security into software delivery.
Removing Uninteresting Bytes in Software FuzzingAftab Hussain
Imagine a world where software fuzzing, the process of mutating bytes in test seeds to uncover hidden and erroneous program behaviors, becomes faster and more effective. A lot depends on the initial seeds, which can significantly dictate the trajectory of a fuzzing campaign, particularly in terms of how long it takes to uncover interesting behaviour in your code. We introduce DIAR, a technique designed to speedup fuzzing campaigns by pinpointing and eliminating those uninteresting bytes in the seeds. Picture this: instead of wasting valuable resources on meaningless mutations in large, bloated seeds, DIAR removes the unnecessary bytes, streamlining the entire process.
In this work, we equipped AFL, a popular fuzzer, with DIAR and examined two critical Linux libraries -- Libxml's xmllint, a tool for parsing xml documents, and Binutil's readelf, an essential debugging and security analysis command-line tool used to display detailed information about ELF (Executable and Linkable Format). Our preliminary results show that AFL+DIAR does not only discover new paths more quickly but also achieves higher coverage overall. This work thus showcases how starting with lean and optimized seeds can lead to faster, more comprehensive fuzzing campaigns -- and DIAR helps you find such seeds.
- These are slides of the talk given at IEEE International Conference on Software Testing Verification and Validation Workshop, ICSTW 2022.
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfPaige Cruz
Monitoring and observability aren’t traditionally found in software curriculums and many of us cobble this knowledge together from whatever vendor or ecosystem we were first introduced to and whatever is a part of your current company’s observability stack.
While the dev and ops silo continues to crumble….many organizations still relegate monitoring & observability as the purview of ops, infra and SRE teams. This is a mistake - achieving a highly observable system requires collaboration up and down the stack.
I, a former op, would like to extend an invitation to all application developers to join the observability party will share these foundational concepts to build on:
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Real world cross-platform testing
1. Real Life Cross-Platform Testing
Peter Edwards
peter@dragonstaff.co.uk
MiltonKeynes.pm
Perl Technical Talk
8th July 2008
1
Real Life Cross-Platform Testing 12/22/12
2. Contents
Background aka "Real Life"
Cross-Platform
Testing
Add Windows Testing Under Unix
Test::MockObject
Test::MockModule
Running Unix unit tests under Windows
Future Plans For Testing
Summary and Links
2
Real Life Cross-Platform Testing 12/22/12
3. Background aka "Real Life"
Content Management System used at BBC to enter XML documents
that are later transformed to make public websites
Client-side
– GUI using WxPerl (WxWidgets)
– WYSIWYG editing
– Talks SOAP over HTTP to server
– Runs under ActiveState Perl
Server-side
– Handles SOAP requests
– Stores document blobs in filesystem
– Stores indexes, metadata in Oracle database
– Runs under Solaris Perl
Usage
– 100s of users
– Time critical publishing : failure during release is not an option
3
Real Life Cross-Platform Testing 12/22/12
4. Cross-Platform
CMS code running on Windows and Solaris
Solaris perl 5.8.8
$ perl -V
Summary of my perl5 (revision 5 version 8 subversion 8) configuration:
Platform:
osname=solaris, osvers=2.10, archname=sun4-solaris
Windows ASPerl 5.8
C:WINNT>perl –V
Summary of my perl5 (revision 5 version 8 subversion 6) configuration:
Platform:
osname=MSWin32, osvers=4.0, archname=MSWin32-x86-multi-thread
4
Real Life Cross-Platform Testing 12/22/12
5. Testing
Unit tests for dev
Automated overnight smoke testing of unit tests
Dev / Staging Test / Live environments
Manual release test on staging test area using
Windows app
Problems
Lots of tests for server side code, very few for
client side because difficult to run 'use Wx' code
on Unix in batch
Existing tests run on Unix, fail on Windows
5
Real Life Cross-Platform Testing 12/22/12
6. Add Windows Testing Under Unix
Need to write lots of client-side tests for
1) GUI
WxPerl -> Gtk+ under Solaris
‘Use Wx’ was failing because no X display
Problems with font sizing and window alignment
Windows-specific components, e.g. ActiveX Altova editor
Installation
Shortcuts, registry Win32::OLE, unzipping archives to Windows Apps dir etc.
Solutions
1) Use Xvfb
$ alias runxvfb='Xvfb :10 -dev vfb screen 0 1152x900x8 > /dev/null 2>&1 &'
Lets you check code compile and call many routines
But how do you test UI rendered properly - interpreting the virtual screen
bitmaps is too hard!
1) Sandboxing and mocking
Mock required Win32 functions
Make them do file I/O to a sandbox area
Test::MockObject - Perl extension for emulating troublesome interfaces
Test::MockModule - Override subroutines in a module for unit testing
6
Real Life Cross-Platform Testing 12/22/12
7. Test::MockObject 1
Helpers
sub make_mock_obj_in_class {
my $class = shift;
my $obj = Test::MockObject->new;
$obj->fake_module($class);
$obj->fake_new($class);
return $obj;
}
sub dump_mock_calls {
my $mockobj = shift;
my $i = 1;
while ( my $name = $mockobj->call_pos($i) ) {
diag " call $i: $name";
my @args = $mockobj->call_args($i);
for (0 .. $#args) {
diag ' arg '.($_ +1).': ';
diag Dumper($args[$_]);
}
$i++;
}
}
7
Real Life Cross-Platform Testing 12/22/12
8. Test::MockObject 2
Mocking
my $wx = make_mock_obj_in_class( 'Wx' );
my $mock_WxPerlSplashProgress = make_mock_obj_in_class( 'Wx::Perl::SplashProgress' );
$mock_WxPerlSplashProgress->set_true(qw( SetLabelColour SetIcon Show SetValue Update Destroy ));
$mock_WxPerlSplashProgress->mock( SetLabel => sub { diag ' SetLabel: '.$_[1] } );
$mock_Win32OLE = make_mock_obj_in_class( 'Win32::OLE' );
$mock_Win32OLE->mock( 'SpecialFolders', sub { shift } );
$mock_Win32OLE->mock( 'AppData', sub { return catdir(qw(data win32), 'Application Data') } );
$mock_Win32OLE->mock( 'StartMenu', sub { catdir(qw(data win32 startmenu)) } );
$mock_Win32OLE->mock( 'Desktop', sub { catdir(qw(data win32 desktop)) } );
$mock_Win32Shortcut = make_mock_obj_in_class( 'Win32::Shortcut' );
$mock_Win32Shortcut->mock( 'Load', sub {
my ($self, $filename) = @_;
$self->{content} = read_file($filename);
return 1;
} );
$mock_Win32Shortcut->mock( 'Path', sub {
my ($self, $path) = @_;
$self->{content} = $path;
} );
$mock_Win32Shortcut->mock( 'Arguments', sub {
my ($self, $args) = @_;
$self->{content} .= ' '.$args . "rn";
} );
$mock_Win32Shortcut->mock( 'Save', sub {
my ($self, $filename) = @_;
write_file($filename, $self->{content} . "writetime ". gmtime() . "rn");
return 1;
} );
$mock_Win32Shortcut->set_true(qw( ShowCmd Description IconLocation Close ));
{ no strict 'refs'; *{'Win32::Shortcut::SW_SHOWMINNOACTIVE'} = sub {}; }
8
Real Life Cross-Platform Testing 12/22/12
10. Test::MockModule 1
Helper
sub mock_module {
my ($module,$options,@functions) = @_;
my $no_auto = defined($options->{no_auto}) ? $options->{no_auto} : 1;
my $create_new = defined($options->{create_new}) ? $options->{create_new} : 1;
my $testmockmodule = new Test::MockModule($module, no_auto => $no_auto);
my $object;
if ($create_new) {
$object = bless {}, $module;
$testmockmodule->mock('new',sub { $logger->log($module,'new',@_); return $object });
}
for my $function (@functions) {
$testmockmodule->mock($function,sub { $logger->log($module,$function,@_) });
}
no strict 'refs';
push @{$module . "::ISA"},'Exporter';
my $module_path = $module;
$module_path =~ s{::}{/}xmsg;
$module_path .= '.pm';
$INC{$module_path} = "1 (Inserted by mock_module())";
return $testmockmodule, $object;
}
10
Real Life Cross-Platform Testing 12/22/12
11. Test::MockModule 2
Mocking
my ($mock_wx_activex_ie, $mock_wx_activex_ie_object)
= mock_module('Wx::ActiveX::IE',{});
my ($mock_wx_activex_event, $mock_wx_activex_event_object)
= mock_module('Wx::ActiveX::Event',{},@Wx::Event::EXPORT_OK);
my ($mock_wx_panel,$mock_wx_panel_object)
= mock_module('Wx::Panel',{}, qw( SetSizer ));
my ($mock_wx_boxsizer,$mock_wx_boxsizer_object)
= mock_module('Wx::BoxSizer',{}, qw( Add ));
Tests - use your objects as normal… then check call sequence
my @mf_calls = $logger->filter({'FLIPClient::UI::MicroForms' => []});
my $call = shift(@mf_calls);
is($call->{function},'set_template','position_change (' . $test->{name} . ') calls set_template');
ok($call->{args}->[1] =~ $test->{template},'position_change (' . $test->{name} . ') sets
template');
$call = shift(@mf_calls);
is($call->{function},'set_data','position_change (' . $test->{name} . ') calls set_data');
is_deeply($call->{args}->[1],$test->{data},'position_change (' . $test->{name} . ') sets data');
11
Real Life Cross-Platform Testing 12/22/12
12. Running Unix unit tests under Windows 1
Some libraries shared between Unix and Windows;
not being tested properly client-side
Perl Portability
– "perldoc perlport“ http://perldoc.perl.org/5.8.8/perlport.html
"When the code will run on only two or three operating systems,
you may need to consider only the differences of those particular
systems. The important thing is to decide where the code will run
and to be deliberate in your decision.“
– Only worrying about Windows and Unix; OpenVMS support is
hard
binmode and chomp - binmode saves headaches on Windows like
EOF ^Z; watch out for CR-LF
use File::Spec::Functions rather than Unix paths
YES : my $path = rel2abs( catdir(qw( data local cache file.txt ));
NO : my $path = './data/local/cache/file.txt';
12
Real Life Cross-Platform Testing 12/22/12
13. Running Unix unit tests under Windows 2
Generic configuration interface with platform-specific subclasses
System.pm
|-- System/Win32.pm
|-- System/Unix.pm
using File::Spec::Functions for paths
Change tests from path strings to regexes using a quote path
separator
my $script = $i->startup('remote');
NO : is( $script, 'scripts/FLIP_real.PL', '$i->startup("remote") script’
YES : $ps = ($^O eq 'MSWin32') ? "" : '/';
$qps = quotemeta $ps;
like( $script, qr{ scripts [$qps] FLIP_real.pl z }xms, '$i-
>startup("remote") script' );
Note PBP style regex
Actually run the tests on multiple platforms
13
Real Life Cross-Platform Testing 12/22/12
14. Future Plans For Testing
Automate application release test under
Windows
– Win32::GuiTest (or pay for WinRunner)
14
Real Life Cross-Platform Testing 12/22/12
15. Summary and Links
Summary
– "perldoc perlport“
– Write cross-platform tests from the outset; convert old ones
– Mock platform-specific GUI or system library calls
– Automate tests (life is short) and get as much coverage as
possible
Links
– WxPerl http://wxperl.sourceforge.net/
– WxWidgets http://docs.wxwidgets.org/trunk/
– "Perl Testing: A Developer's Notebook" Ian Langworth &
chromatic, O'Reilly Media, Inc., 2005
http://preview.tinyurl.com/5k6wnc
Thank you. Any Questions?
15
Real Life Cross-Platform Testing 12/22/12