Have you ever been annoyed by testing classes or functions operating on the file system? Be it tests that rely on presence of physical files, the problem of not cleaning up correctly after the test run or checking that your algorithm creates the correct directories and files with correct file permissions. Then this is for you: vfsStream to the rescue!
The Perforce Web Content Management System development team, lacking a pre-existing solution in PHP, designed and implemented their own object model and record layer to ease the interaction of the system with the Perforce Server. This session will focus on how users can access files in Perforce via a simple CRUD API, the subsystems exposed, and their usage.
This describes a Functional Programming approach to computing AWS Glacier "tree hash" values, hiding the tail-call elimination in Perl5 with a keyword and also shows how to accomplish the same result in Perl6.
This was the talk actually given at YAPC::NA 2016 by Dr. Conway and myself.
Perl6 regular expression ("regex") syntax has a number of improvements over the Perl5 syntax. The inclusion of grammars as first-class entities in the language makes many uses of regexes clearer, simpler, and more maintainable. This talk looks at a few improvements in the regex syntax and also at how grammars can help make regex use cleaner and simpler.
The Perforce Web Content Management System development team, lacking a pre-existing solution in PHP, designed and implemented their own object model and record layer to ease the interaction of the system with the Perforce Server. This session will focus on how users can access files in Perforce via a simple CRUD API, the subsystems exposed, and their usage.
This describes a Functional Programming approach to computing AWS Glacier "tree hash" values, hiding the tail-call elimination in Perl5 with a keyword and also shows how to accomplish the same result in Perl6.
This was the talk actually given at YAPC::NA 2016 by Dr. Conway and myself.
Perl6 regular expression ("regex") syntax has a number of improvements over the Perl5 syntax. The inclusion of grammars as first-class entities in the language makes many uses of regexes clearer, simpler, and more maintainable. This talk looks at a few improvements in the regex syntax and also at how grammars can help make regex use cleaner and simpler.
A lot of people using PHPunit for testing their source code. While I was observing my team I recognized most of them are only using the standard assertions like 'assertEquals()' and are complaining about how hard it is to test the code even when the tests are written first. This talk is about all the stuff not used on a daily basis and it digs deep into uncommon features of PHPUnit.
PHP 7.1 contains new exciting features and improvements that can facilitate the life of many PHP developers. During the talk I will show some of these new features like nullable types, catching of multiple exceptions, the curl HTTP/2 server push support, void return types, Class constant visibility, authenticated encryption in OpenSSL with GCM and CCM modes, and more.
May 2006 presentation to the Dallas/Ft. Worth Perl Mongers on Perl's tie() functionality and how to use it to create fancy behavior for familiar data types
Go beyond the documentation and explore some of what's possible if you stretch symfony to its limits. We will look at a number of aspects of symfony 1.4 and Doctrine 1.2 and tease out some powerful functionality you may not have expected to find, but will doubtless be able to use. Topics covered will include routing, forms, the config cache and record listeners. If you're comfortable in symfony and wondering what's next, this session is for you.
A lot of people using PHPunit for testing their source code. While I was observing my team I recognized most of them are only using the standard assertions like 'assertEquals()' and are complaining about how hard it is to test the code even when the tests are written first. This talk is about all the stuff not used on a daily basis and it digs deep into uncommon features of PHPUnit.
PHP 7.1 contains new exciting features and improvements that can facilitate the life of many PHP developers. During the talk I will show some of these new features like nullable types, catching of multiple exceptions, the curl HTTP/2 server push support, void return types, Class constant visibility, authenticated encryption in OpenSSL with GCM and CCM modes, and more.
May 2006 presentation to the Dallas/Ft. Worth Perl Mongers on Perl's tie() functionality and how to use it to create fancy behavior for familiar data types
Go beyond the documentation and explore some of what's possible if you stretch symfony to its limits. We will look at a number of aspects of symfony 1.4 and Doctrine 1.2 and tease out some powerful functionality you may not have expected to find, but will doubtless be able to use. Topics covered will include routing, forms, the config cache and record listeners. If you're comfortable in symfony and wondering what's next, this session is for you.
Presentation for azPHP on setting up a new project using Zend_Tool. Also goes over creating basic modules, controllers, actions, models and layouts.
All code in the presentation has not necessarily been tested. Will update presentation when done.
Watch Erik's presentation on PHP Unit Testing to gain familiarity with unit tests and unit testing here at Tagged, with the testing framework currently in place and also learn how to write (better) unit tests. Download his slides here or email him at ejohannessen@tagged.com.
Zend Framework covers many day-to-day solutions and fits perfectly for most jobs, but if you\'re facing a challenge that\'s not yet covered in the framework, you can easily extend components to fit your needs. This way you still have the power of Zend Framework without having to re-write all from scratch.
Refactoring, Agile Entwicklung, Continuous Integration – all diese für nachhaltigen Erfolg wichtigen Vorgehensweisen setzen Erfahrung mit Unit Testing voraus. Abseits von den üblichen "Bowling"-Beispielen möchten wir gerne einen Crashkurs inkl. Best Practices für das erfolgreiche Unit Testing durchführen. Anhand eines Beispielprojekts auf Basis des Zend Frameworks werden wir nach der Installation von PHPUnit auf allen Notebooks gemeinsam eine kleine Applikation aufbauen, die durchgehend Test-driven entwickelt wird.
In 2010, I told everyone how to start unit testing Zend Framework applications. In 2011, let’s take this a step further by testing services, work flows and performance. Looking to raise the bar on quality? Let this talk be the push you need to improve your Zend Framework projects.
Best Practices in Plugin Development (WordCamp Seattle)andrewnacin
My talk -- officially named "Y U NO CODE WELL" -- at WordCamp Seattle 2011 on best practices during plugin development. Find the video, as it provides some good context and conversation.
Johannes Schlüter's PHPNW08 slides:
The current PHP version, PHP 5.3 introduced a multitude of new language features, most notably namespaces and late static binding, new extensions such as phar, as well as numerous other improvements. Even so, this power-packed release boasts better performance than older PHP releases. This talk will give you a good overview about PHP 5.3 and show some less known features in detail.
Similar to vfsStream - a better approach for file system dependent tests (20)
A tale of scale & speed: How the US Navy is enabling software delivery from l...sonjaschweigert1
Rapid and secure feature delivery is a goal across every application team and every branch of the DoD. The Navy’s DevSecOps platform, Party Barge, has achieved:
- Reduction in onboarding time from 5 weeks to 1 day
- Improved developer experience and productivity through actionable findings and reduction of false positives
- Maintenance of superior security standards and inherent policy enforcement with Authorization to Operate (ATO)
Development teams can ship efficiently and ensure applications are cyber ready for Navy Authorizing Officials (AOs). In this webinar, Sigma Defense and Anchore will give attendees a look behind the scenes and demo secure pipeline automation and security artifacts that speed up application ATO and time to production.
We will cover:
- How to remove silos in DevSecOps
- How to build efficient development pipeline roles and component templates
- How to deliver security artifacts that matter for ATO’s (SBOMs, vulnerability reports, and policy evidence)
- How to streamline operations with automated policy checks on container images
Elevating Tactical DDD Patterns Through Object CalisthenicsDorra BARTAGUIZ
After immersing yourself in the blue book and its red counterpart, attending DDD-focused conferences, and applying tactical patterns, you're left with a crucial question: How do I ensure my design is effective? Tactical patterns within Domain-Driven Design (DDD) serve as guiding principles for creating clear and manageable domain models. However, achieving success with these patterns requires additional guidance. Interestingly, we've observed that a set of constraints initially designed for training purposes remarkably aligns with effective pattern implementation, offering a more ‘mechanical’ approach. Let's explore together how Object Calisthenics can elevate the design of your tactical DDD patterns, offering concrete help for those venturing into DDD for the first time!
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.
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...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.
Generative AI Deep Dive: Advancing from Proof of Concept to ProductionAggregage
Join Maher Hanafi, VP of Engineering at Betterworks, in this new session where he'll share a practical framework to transform Gen AI prototypes into impactful products! He'll delve into the complexities of data collection and management, model selection and optimization, and ensuring security, scalability, and responsible use.
PHP Frameworks: I want to break free (IPC Berlin 2024)Ralf Eggert
In this presentation, we examine the challenges and limitations of relying too heavily on PHP frameworks in web development. We discuss the history of PHP and its frameworks to understand how this dependence has evolved. The focus will be on providing concrete tips and strategies to reduce reliance on these frameworks, based on real-world examples and practical considerations. The goal is to equip developers with the skills and knowledge to create more flexible and future-proof web applications. We'll explore the importance of maintaining autonomy in a rapidly changing tech landscape and how to make informed decisions in PHP development.
This talk is aimed at encouraging a more independent approach to using PHP frameworks, moving towards a more flexible and future-proof approach to PHP development.
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.
State of ICS and IoT Cyber Threat Landscape Report 2024 previewPrayukth K V
The IoT and OT threat landscape report has been prepared by the Threat Research Team at Sectrio using data from Sectrio, cyber threat intelligence farming facilities spread across over 85 cities around the world. In addition, Sectrio also runs AI-based advanced threat and payload engagement facilities that serve as sinks to attract and engage sophisticated threat actors, and newer malware including new variants and latent threats that are at an earlier stage of development.
The latest edition of the OT/ICS and IoT security Threat Landscape Report 2024 also covers:
State of global ICS asset and network exposure
Sectoral targets and attacks as well as the cost of ransom
Global APT activity, AI usage, actor and tactic profiles, and implications
Rise in volumes of AI-powered cyberattacks
Major cyber events in 2024
Malware and malicious payload trends
Cyberattack types and targets
Vulnerability exploit attempts on CVEs
Attacks on counties – USA
Expansion of bot farms – how, where, and why
In-depth analysis of the cyber threat landscape across North America, South America, Europe, APAC, and the Middle East
Why are attacks on smart factories rising?
Cyber risk predictions
Axis of attacks – Europe
Systemic attacks in the Middle East
Download the full report from here:
https://sectrio.com/resources/ot-threat-landscape-reports/sectrio-releases-ot-ics-and-iot-security-threat-landscape-report-2024/
Sudheer Mechineni, Head of Application Frameworks, Standard Chartered Bank
Discover how Standard Chartered Bank harnessed the power of Neo4j to transform complex data access challenges into a dynamic, scalable graph database solution. This keynote will cover their journey from initial adoption to deploying a fully automated, enterprise-grade causal cluster, highlighting key strategies for modelling organisational changes and ensuring robust disaster recovery. Learn how these innovations have not only enhanced Standard Chartered Bank’s data infrastructure but also positioned them as pioneers in the banking sector’s adoption of graph technology.
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...DanBrown980551
Do you want to learn how to model and simulate an electrical network from scratch in under an hour?
Then welcome to this PowSyBl workshop, hosted by Rte, the French Transmission System Operator (TSO)!
During the webinar, you will discover the PowSyBl ecosystem as well as handle and study an electrical network through an interactive Python notebook.
PowSyBl is an open source project hosted by LF Energy, which offers a comprehensive set of features for electrical grid modelling and simulation. Among other advanced features, PowSyBl provides:
- A fully editable and extendable library for grid component modelling;
- Visualization tools to display your network;
- Grid simulation tools, such as power flows, security analyses (with or without remedial actions) and sensitivity analyses;
The framework is mostly written in Java, with a Python binding so that Python developers can access PowSyBl functionalities as well.
What you will learn during the webinar:
- For beginners: discover PowSyBl's functionalities through a quick general presentation and the notebook, without needing any expert coding skills;
- For advanced developers: master the skills to efficiently apply PowSyBl functionalities to your real-world scenarios.
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...Neo4j
Leonard Jayamohan, Partner & Generative AI Lead, Deloitte
This keynote will reveal how Deloitte leverages Neo4j’s graph power for groundbreaking digital twin solutions, achieving a staggering 100x performance boost. Discover the essential role knowledge graphs play in successful generative AI implementations. Plus, get an exclusive look at an innovative Neo4j + Generative AI solution Deloitte is developing in-house.
14. Basic example: a method to test class Example { public function __construct($id) { $this->id = $id; } public function setDirectory($dir) { $this->dir = $dir . '/' . $this->id; if (file_exists($this->dir) === false) { mkdir($this->dir, 0700, true); } } … }
15. Basic example: traditional test $DIR = dirname(__FILE__); public function setUp() { if (file_exists($DIR . '/id')) { rmdir($DIR . '/id'); } } public function tearDown() { if (file_exists($DIR . '/id')) { rmdir($DIR . '/id'); } } public function testDirectoryIsCreated() { $example = new Example('id'); $this->assertFalse(file_exists($DIR . '/id')); $example->setDirectory($DIR); $this->assertTrue(file_exists($DIR . '/id')); }
16. Basic example: vfsStream test public function setUp() { vfsStreamWrapper::register(); $root = new vfsStreamDirectory('aDir'); vfsStreamWrapper::setRoot($root); } public function testDirectoryIsCreated() { $url = vfsStream::url('aDir/id'); $example = new Example('id'); $this->assertFalse(file_exists($url)); $example->setDirectory(vfsStream::url('aDir')); $this->assertTrue(file_exists($url)); }
17.
18.
19.
20. Example with file mode class Example { public function __construct($id, $mode = 0700) { $this->id = $id; $this->mode = $mode; } public function setDirectory($dir) { $this->dir = $dir . '/' . $this->id; if (file_exists($this->dir) === false) { mkdir($this->directory, $this->mode, true); } } … }
21. Example with file mode, cont. $DIR = dirname(__FILE__); public function testDirDefaultFilePermissions() { $example = new Example('id'); $example->setDirectory($DIR); if (DIRECTORY_SEPARATOR === '') { $this->assertEquals(40777, decoct(fileperms($DIR . '/id'))); } else { $this->assertEquals(40700, decoct(fileperms($DIR . '/id'))); } } public function testDirDifferentFilePermissions() { $example = new Example('id', 0755); $example->setDirectory($DIR); if (DIRECTORY_SEPARATOR === '') { $this->assertEquals(40777, decoct(fileperms($DIR . '/id'))); } else { $this->assertEquals(40755, decoct(fileperms($DIR . '/id'))); } }
22. Example with file mode, cont. public function setUp() { vfsStreamWrapper::register(); $this->root = new vfsStreamDirectory('aDir'); vfsStreamWrapper::setRoot($this->root); } public function testDirDefaultFilePermissions() { $example = new Example('id'); $example->setDirectory(vfsStream::url('aDir')); $this->assertEquals(0700, $this->root->getChild('id')->getPermissions()); } public function testDirDifferentFilePermissions() { $example = new Example('id', 0755); $example->setDirectory(vfsStream::url('aDir')); $this->assertEquals(0755, $this->root->getChild('id')->getPermissions()); }
23.
24. Different config files class RssFeedController { public function __construct($configPath) { $feeds = Properties::fromFile($configPath . '/rss-feeds.ini') ->getSection('feeds', array()); if (count($feeds) === 0) { throw new ConfigurationException(); } $this->routeName = valueFromRequest(); if (null === $this->routeName) { // no special feed requested, use first configured one reset($feeds); $this->routeName = key($feeds); } } … }
25. Different config files, cont. public function setUp() { vfsStreamWrapper::register(); $root = new vfsStreamDirectory('config'); vfsStreamWrapper::setRoot($root); $this->configFile = vfsStream::newFile('rss-feeds.ini') ->at($root); } /** * @test * @expectedException FileNotFoundException **/ public function loadFeedsFailsIfFeedConfigFileDoesNotExist() { $example = new RssFeedController(vfsStream::url('doesNotExist')); }
26. Different config files, cont. 2 /** * @test * @expectedException ConfigurationException **/ public function noFeedsSectionConfiguredThrowsException() { $this->configFile->setContent(''); $example = new RssFeedController(vfsStream::url('config')); }
27. Different config files, cont. 3 /** * @test * @expectedException ConfigurationException **/ public function noFeedsConfiguredThrowsException() { $this->configFile->setContent('[feeds]'); $example = new RssFeedController(vfsStream::url('config')); }
28. Different config files, cont. 4 /** * @test **/ public function selectsFirstFeedIfNoneGivenWithRequestValue() { $this->configFile->setContent('[feeds] default = "org::stubbles::test::xml::rss::DefaultFeed"'); $example = new RssFeedController(vfsStream::url('config')); // assertions that the default feed was selected … }
29. Different config files, cont. 5 /** * @test **/ public function selectsOtherFeedBasedOnRequestValue() { $this->configFile->setContent("[feeds] default = amp;quot;org::stubbles::test::xml::rss::DefaultFeedamp;quot; other = amp;quot;org::stubbles::test::xml::rss::OtherFeedamp;quot;"); $example = new RssFeedController(vfsStream::url('config')); // assertions that the other feed was selected … }
30.
31.
32. File permissions class Example { public function writeConfig($config, $configFile) { file_put_contents($configFile, serialize($config)); } … }
33. File permissions, the tests /** * @test */ public function normalTest() { vfsStreamWrapper::setRoot(vfsStream::newDirectory('exampleDir')); $example = new FilePermissionsExample(); $example->writeConfig(array('foo' => 'bar'), vfsStream::url('exampleDir/writable.ini') ); // assertions here }
34. File permissions, another test /** * @test */ public function directoryNotWritable() { vfsStreamWrapper::setRoot( vfsStream::newDirectory('exampleDir', 0444) ); $example = new FilePermissionsExample(); $example->writeConfig(array('foo' => 'bar'), vfsStream::url('exampleDir/config.ini') ); }