Efficient Rails Test-Driven Development Week #1. A class by Wolfram Arnold of rubyfocus.biz, in collaboration with Sarah Allen of blazingcloud.net and marakana.com
Consuming REST services with ActiveResourceWolfram Arnold
Talk given at the SF Ruby Meetup on 12/8/2011.
It references these github projects:
demo project:
git://github.com/wolframarnold/SFMeetup-Talk-on-ActiveResource-2011-12-08.git
server:
git://github.com/wolframarnold/where-have-you-been.git, branch: sfmeetup_2011_12_08
Scala.js is a compiler that compiles Scala source code to equivalent Javascript code. That lets you write Scala code that you can run in a web browser, or other environments (Chrome plugins, Node.js, etc.) where Javascript is supported. This presentation is an introduction to ScalaJS.
Consuming REST services with ActiveResourceWolfram Arnold
Talk given at the SF Ruby Meetup on 12/8/2011.
It references these github projects:
demo project:
git://github.com/wolframarnold/SFMeetup-Talk-on-ActiveResource-2011-12-08.git
server:
git://github.com/wolframarnold/where-have-you-been.git, branch: sfmeetup_2011_12_08
Scala.js is a compiler that compiles Scala source code to equivalent Javascript code. That lets you write Scala code that you can run in a web browser, or other environments (Chrome plugins, Node.js, etc.) where Javascript is supported. This presentation is an introduction to ScalaJS.
The Angular framework is great for building large-scale web applications that can be maintained and enhanced. When you're building enterprise-level apps, testing is vital to the development process. Testing improves the quality of code and reduces maintenance, saving both time and money. Developers who know how to build and leverage tests are highly valued by their clients and companies.
Best practices say: Software testing should start early in the Software Development Life Cycle. Since automation testing follows SDLC we should start from API (when UI has not ready yet). On practice, most projects start from UI automation. It’s can be quite a hard and painful way especially for manual test engineers who only begin automate testing. API automation is much simple and easier to learn. During the talk, Roman share his knowledge and experience how quickly start API automation testing on the project.
Refactoring @ Mindvalley: Smells, Techniques and PatternsTristan Gomez
Every week my team commits really good, clean code. I decided to get the best of the commits and showcase what makes them good, what smells they address, and what techniques they used.
django forms are becoming disconnected form the frontend as we move towards API heavy systems. We attempt to bridge the gap by delivering form definition over API, render it in the frontend dynamically using Backbone & Handlebars, provide mechanism for submitting & validating forms over API.
2016 - Serverless Microservices on AWS with API Gateway and Lambdadevopsdaysaustin
Presentation by Matt Barlow
Someone just gave you an idea for a new microservice. How quickly can you build it?
Using Swagger, API Gateway, and Lambda, we'll go from idea to HTTP response with just a few edits. We'll look at how Swagger can auto generate our API Gateway service, docs, client libraries, monitors, and tests, saving us a ton of work. We'll make code changes, version them in Lambda, and evaluate them with curl or Postman in seconds.
How to improve your code quality? The answer is continuous refactoring. Learn more about refactoring. Know the most frequent code smells (antipatterns), telling when to refactor. Go through the catalog of well-known refactorings, telling how to improve your code.
CRUD APIs can be a very powerful tool. However, simply PUTing and POSTing entities can lead to anemic endpoints that lack business value. Go beyond the traditional CRUD API and provide more expressive and meaningful REST endpoints with an API crafted with a commanding paradigm.
Presenting acts_as_most_popular: A plugin to cache most popular lists, such as most viewed videos, common to many social networking applications. acts_as_most_popular is built on top of Cache Money
The Angular framework is great for building large-scale web applications that can be maintained and enhanced. When you're building enterprise-level apps, testing is vital to the development process. Testing improves the quality of code and reduces maintenance, saving both time and money. Developers who know how to build and leverage tests are highly valued by their clients and companies.
Best practices say: Software testing should start early in the Software Development Life Cycle. Since automation testing follows SDLC we should start from API (when UI has not ready yet). On practice, most projects start from UI automation. It’s can be quite a hard and painful way especially for manual test engineers who only begin automate testing. API automation is much simple and easier to learn. During the talk, Roman share his knowledge and experience how quickly start API automation testing on the project.
Refactoring @ Mindvalley: Smells, Techniques and PatternsTristan Gomez
Every week my team commits really good, clean code. I decided to get the best of the commits and showcase what makes them good, what smells they address, and what techniques they used.
django forms are becoming disconnected form the frontend as we move towards API heavy systems. We attempt to bridge the gap by delivering form definition over API, render it in the frontend dynamically using Backbone & Handlebars, provide mechanism for submitting & validating forms over API.
2016 - Serverless Microservices on AWS with API Gateway and Lambdadevopsdaysaustin
Presentation by Matt Barlow
Someone just gave you an idea for a new microservice. How quickly can you build it?
Using Swagger, API Gateway, and Lambda, we'll go from idea to HTTP response with just a few edits. We'll look at how Swagger can auto generate our API Gateway service, docs, client libraries, monitors, and tests, saving us a ton of work. We'll make code changes, version them in Lambda, and evaluate them with curl or Postman in seconds.
How to improve your code quality? The answer is continuous refactoring. Learn more about refactoring. Know the most frequent code smells (antipatterns), telling when to refactor. Go through the catalog of well-known refactorings, telling how to improve your code.
CRUD APIs can be a very powerful tool. However, simply PUTing and POSTing entities can lead to anemic endpoints that lack business value. Go beyond the traditional CRUD API and provide more expressive and meaningful REST endpoints with an API crafted with a commanding paradigm.
Presenting acts_as_most_popular: A plugin to cache most popular lists, such as most viewed videos, common to many social networking applications. acts_as_most_popular is built on top of Cache Money
Cache Money is a new model caching framework for Active Record that transparently stores, synchronizes and expires model instances in memcached, through Active Record callbacks. It's a framework that provides almost all the pieces of transparently turning an application without model caching into one with model caching at the flip of a switch. In this presentation I'll show what the framework delivers, its limitation and what problems to watch out for when putting it in as drop-in intermediary for your database connection.
How to use simple forms with nested models and single access points into web api's without the view or controller logic getting messy. Demonstration of the Rails 2.3 accepts_nested_attributes_for feature
Video: http://blip.tv/file/3957941
An architect’s job is to reduce complexity, not increase it. Yet the developer life is filled with jargon, acronyms, and seemingly infinite choices. So how do we know when complexity makes sense? We’ll learn when abstractions are justified and discuss how to structure applications so they’re maintainable, scalable, and testable.
We’ll make sure everyone is comfy with the core jargon like N-Teir, separation of concerns, and loose coupling. Then we’ll dive into various patterns for implementing the three common layers: data access, business logic, and presentation. You’ll learn when table module, active record, DDD, and ORMs make sense and walk away with the tools to better evaluate and justify complexity. We’ll focus on the value of keeping things simple whenever we can. Examples are presented in C# in Visual Studio but developers in Java, PHP, and other C-like languages should be able to follow right along.
The is from the book Agile Development in .NET by Dan Hermes. Most Agile methodologies used in .NET shops nationwide are variations of Scrum and Extreme Programming(XP). This booklet covers these tools and techniques: Test-driven Development (TDD), Behavior-driven Development (BDD), Continuous Integration (CI), and Refactoring to Patterns. The QuickNotes series covers relevant topics in software development to provide the reader with a swift overview of important trends, terms, and concepts. This book is available at Amazon.com.
Better and Faster: A Journey Toward Clean Code and EnjoymentChris Holland
Video: http://bit.ly/tdd-talk-2
This slideshow has links, download the PDF to click them.
While this presentation touches on PHP a fair bit, it does make parallels to other ecosystems such as Java and C#/.Net, building toward an approach for building Web Applications in a Test-Driven way.
Have you ever jumped into a legacy software project and gotten to a point where it takes a near-infinite amount of time to deliver any new feature, for fear of breaking legacy functionality you’ve barely begun to understand? Software Engineering can be extremely difficult and maddening. But it doesn’t have to be. We will explore leveraging TDD and OOP principles to make Software Engineering fun again.
Coding exercises supporting this presentation are available here:
http://bit.ly/tdd-vids
AWS and Dynatrace: Moving your Cloud Strategy to the Next LevelDynatrace
AWS and Dynatrace: Moving your Cloud Strategy to the Next Level
On-Demand Webcast
AWS re:Invent was an exciting time for Dynatrace and we received a lot of “Wows” on our capabilities. We got to demonstrate the only AI-based, full-stack monitoring solution to thousands of AWS prospects and users. We announced our AWS Certified DevOps Competency partnership, and we introduced DAVIS, our natural-language voice interface, to thousands of attendees.
We know that many of you couldn’t attend the event in Las Vegas, so we wanted to share some of the key highlights from the show. And for those of you who were there, you may not have seen all of the benefits Dynatrace provides in the AWS ecosystem due to time constraints of sessions and the large tradeshow floor.
Listen to this 30 Minute webcast where Alois Reitbauer and Franz Karlsberger recap some of the highlights of the event, including:
How Dynatrace, as an AWS certified Migration Competency partner, uniquely supports enterprise migrations to AWS
How to achieve faster feedback and improved lead times with AWS CodePipeline and Dynatrace
An overview of the first ever VoiceOps and ChatOps interface via DAVIS, based on our AI approach to full-stack monitoring
One of the biggest problems of software projects is that, while the practice of software development is commonly thought of as engineering, it is inherently a creative discipline; hence, many things about it are hard to measure. While simple yardsticks like test coverage and cyclomatic complexity are important for code quality, what other metrics can we apply to answer questions about our code? What coding conventions or development practices can we implement to make our code easier to measure? We'll take a tour through some processes and tools you can implement to begin improving code quality in your team or organization, and see what a difference it makes to long-term project maintainability. More importantly, we'll look at how we can move beyond today's tools to answer higher-level questions of code quality. Can 'good code' be quantified?
One of the biggest problems of software projects is that, while the practice of software development is commonly thought of as engineering, it is inherently a creative discipline; hence, many things about it are hard to measure. While simple yardsticks like test coverage and cyclomatic complexity are important for code quality, what other metrics can we apply to answer questions about our code? What coding conventions or development practices can we implement to make our code easier to measure? We'll take a tour through some processes and tools you can implement to begin improving code quality in your team or organization, and see what a difference it makes to long-term project maintainability. More importantly, we'll look at how we can move beyond today's tools to answer higher-level questions of code quality. Can 'good code' be quantified?
As presented to the Milwaukee Alt.Net group on November 21st, 2011.
UPDATE April 19, 2012: added some domain logic organization slides using Fowler's 4 basic patterns.
Coding Naked – Practical steps to moving towards & embracing TDD. We'll overview the normal roadblocks that people typically run in to, and practical ways to overcome those road blocks on your way to embracing Test Driven Development - make coding without tests as uncomfortable as coding naked!
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/
Accelerate your Kubernetes clusters with Varnish CachingThijs Feryn
A presentation about the usage and availability of Varnish on Kubernetes. This talk explores the capabilities of Varnish caching and shows how to use the Varnish Helm chart to deploy it to Kubernetes.
This presentation was delivered at K8SUG Singapore. See https://feryn.eu/presentations/accelerate-your-kubernetes-clusters-with-varnish-caching-k8sug-singapore-28-2024 for more details.
JMeter webinar - integration with InfluxDB and GrafanaRTTS
Watch this recorded webinar about real-time monitoring of application performance. See how to integrate Apache JMeter, the open-source leader in performance testing, with InfluxDB, the open-source time-series database, and Grafana, the open-source analytics and visualization application.
In this webinar, we will review the benefits of leveraging InfluxDB and Grafana when executing load tests and demonstrate how these tools are used to visualize performance metrics.
Length: 30 minutes
Session Overview
-------------------------------------------
During this webinar, we will cover the following topics while demonstrating the integrations of JMeter, InfluxDB and Grafana:
- What out-of-the-box solutions are available for real-time monitoring JMeter tests?
- What are the benefits of integrating InfluxDB and Grafana into the load testing stack?
- Which features are provided by Grafana?
- Demonstration of InfluxDB and Grafana using a practice web application
To view the webinar recording, go to:
https://www.rttsweb.com/jmeter-integration-webinar
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf91mobiles
91mobiles recently conducted a Smart TV Buyer Insights Survey in which we asked over 3,000 respondents about the TV they own, aspects they look at on a new TV, and their TV buying preferences.
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Ramesh Iyer
In today's fast-changing business world, Companies that adapt and embrace new ideas often need help to keep up with the competition. However, fostering a culture of innovation takes much work. It takes vision, leadership and willingness to take risks in the right proportion. Sachin Dev Duggal, co-founder of Builder.ai, has perfected the art of this balance, creating a company culture where creativity and growth are nurtured at each stage.
Generating a custom Ruby SDK for your web service or Rails API using Smithyg2nightmarescribd
Have you ever wanted a Ruby client API to communicate with your web service? Smithy is a protocol-agnostic language for defining services and SDKs. Smithy Ruby is an implementation of Smithy that generates a Ruby SDK using a Smithy model. In this talk, we will explore Smithy and Smithy Ruby to learn how to generate custom feature-rich SDKs that can communicate with any web service, such as a Rails JSON API.
Essentials of Automations: Optimizing FME Workflows with ParametersSafe Software
Are you looking to streamline your workflows and boost your projects’ efficiency? Do you find yourself searching for ways to add flexibility and control over your FME workflows? If so, you’re in the right place.
Join us for an insightful dive into the world of FME parameters, a critical element in optimizing workflow efficiency. This webinar marks the beginning of our three-part “Essentials of Automation” series. This first webinar is designed to equip you with the knowledge and skills to utilize parameters effectively: enhancing the flexibility, maintainability, and user control of your FME projects.
Here’s what you’ll gain:
- Essentials of FME Parameters: Understand the pivotal role of parameters, including Reader/Writer, Transformer, User, and FME Flow categories. Discover how they are the key to unlocking automation and optimization within your workflows.
- Practical Applications in FME Form: Delve into key user parameter types including choice, connections, and file URLs. Allow users to control how a workflow runs, making your workflows more reusable. Learn to import values and deliver the best user experience for your workflows while enhancing accuracy.
- Optimization Strategies in FME Flow: Explore the creation and strategic deployment of parameters in FME Flow, including the use of deployment and geometry parameters, to maximize workflow efficiency.
- Pro Tips for Success: Gain insights on parameterizing connections and leveraging new features like Conditional Visibility for clarity and simplicity.
We’ll wrap up with a glimpse into future webinars, followed by a Q&A session to address your specific questions surrounding this topic.
Don’t miss this opportunity to elevate your FME expertise and drive your projects to new heights of efficiency.
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Tobias Schneck
As AI technology is pushing into IT I was wondering myself, as an “infrastructure container kubernetes guy”, how get this fancy AI technology get managed from an infrastructure operational view? Is it possible to apply our lovely cloud native principals as well? What benefit’s both technologies could bring to each other?
Let me take this questions and provide you a short journey through existing deployment models and use cases for AI software. On practical examples, we discuss what cloud/on-premise strategy we may need for applying it to our own infrastructure to get it to work from an enterprise perspective. I want to give an overview about infrastructure requirements and technologies, what could be beneficial or limiting your AI use cases in an enterprise environment. An interactive Demo will give you some insides, what approaches I got already working for real.
UiPath Test Automation using UiPath Test Suite series, part 3DianaGray10
Welcome to UiPath Test Automation using UiPath Test Suite series part 3. In this session, we will cover desktop automation along with UI automation.
Topics covered:
UI automation Introduction,
UI automation Sample
Desktop automation flow
Pradeep Chinnala, Senior Consultant Automation Developer @WonderBotz and UiPath MVP
Deepak Rai, Automation Practice Lead, Boundaryless Group and UiPath MVP
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.
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
2010-07-19_rails_tdd_week1
1. Efficient Rails Test-Driven
Development
Wolfram Arnold
www.rubyfocus.biz
In collaboration with:
Sarah Allen, BlazingCloud.net
marakana.com
2. Class Outline
Week #1
The economics of testing
Testing in layers, design patterns
Toolbox: RSpec with Rails
RSpec & Models
Week #2
A culture of testing: Why TDD? How to TDD?
Testing & Data Dependencies
Toolbox: Fixtures, Factories, Mocks & Stubs
3. Class Outline
Week #3
Controller testing
View, Helper, Routes Testing
How much is enough? How much is too much?
Week #4
Refactoring code & tests, custom matchers
API Testing
Remote data setup
Cucumber for API testing & documentation
4. Class Outline
Week #5
Integration Testing—when and how?
Toolbox: Cucumber, Selenium & Friends
Page Object Pattern
Week #6
TDD—what next?
BDD, Agile Process, XP → VDD: Value-Driven
Development
Advanced/Special Requests
5. What you can expect
Presentation, Examples
Answers to questions
A range of material from current development
practice
Homework
Fluidity & adaptability
Fun
6. It works best, when...
Active participation
Try something new
Focus
Team Effort
Pairing
Utilizing the resources in class: TA's, participants
Discussions in public
Class Q&A
Mailing list
8. Why “efficient” and “testing”?
“Testing takes too much time.”
“It's more efficient to test later.”
“Testing is the responsibility of QA, not
developers.”
“It's not practical to test X.”
Tests break when data changes.
Tests break when design changes.
9. The Role of Testing
Development without tests...
fails to empower developers to efficiently take
responsibility for quality of the code delivered
makes collaboration harder
build narrow silos of expertise
instills fear & resistance to change
makes documentation a chore
stops being efficient very soon
10. TDD: Keeping cost of change low
Cost per change
without
TDD
with
TDD
Time
11. Why?
Non-TDD
Accumulates “technical debt” unchecked
Removal of technical debt carries risk
The more technical debt, the higher the risk
Existing technical debt attracts more technical debt
Like compound interest
People are most likely to do what others did before them
To break the pattern heroic discipline & coordination
required
12. Testing in Layers
Application, Browser UI Selenium
RSpec Integration Test::Unit Integration
Application, Server
Cucumber, Webrat
RSpec RSpec
Views Helpers
Views Helpers
RSpec RSpec Test::Unit Functional
Controller Routes
Controller Routes
RSpec Test::Unit
Model
Model
13. Cost of Testing
Layers
Application, Browser UI
Application, Server
Views Helpers
Controller Routes
Model
Cost
14. Cost of Testing
Relationship to data
most
Application, Browser UI removed
Application, Server
Views Helpers
Controller Routes
Model closest
Cost
15. Best ROI for Testing
Layers
Application, Browser UI
Application, Server
Views Helpers
Controller Routes
Model
Impact/Line of Test Code
16. TDD & Design Patterns
Skinny Controller— ➢ Designed to move logic
Fat Model from higher to lower
DRY application layers
named_scope ➢ Following design
patterns makes testing
Proxy Associations easier
Validations ➢ Code written following
... TDD economics will
naturally converge on
these design patterns!
19. RSpec Verifications
should respond_to
should be_nil
→ works with any ? method (so-called “predicates”)
should be_valid
should_not be_nil; should_not be_valid
lambda {...}.should change(), {}, .from().to(), .by()
should eql, ==, equal
26. Story Exercise #1
A Person object must have a first and last name.
A Person object can construct a full name from
the first and last name.
A Person object has an optional middle name.
A Person object returns a full name including, if
present, the middle name.
27. RSpec ==, eql, equal
obj.should == 5 5 == 5
obj.should eql(5) 5.eql 5
obj.should equal(5) 5.equal 5
Object Equality vs. Identity Use ==
eql, == compare values Unless you know you
need something else
equal, === compare objects,
classes
Warning! Do not use != with RSpec.
Use should_not instead.
28. RSpec should change
lambda {
Person.create
}.should change(Person, :count).by(1)
lambda {
@bob.addresses.create(:street => “...”)
}.should change(@bob.addresses, :count).by(1)
nd
Warning: The 2 example is incorrect!
29. RSpec should change
lambda {
# code that causes a change
}.should change(object, :method).by(difference)
or
should change(object,
:method).from(initial).to(final)
The object typically is a class, if not, be wary of
reload!
30. should change with block
lambda {
# code that causes a change
}.should change { expression }.by(difference)
or
should change { expression }.from(initial).to(final)
32. Homework
A Person should save correctly.
A Person can have many Addresses.
A Person's Address must have a street, city and
zip.
A Person's Address can have an optional country.
If the country is left blank, it should default to
“USA” prior to saving.
33. BizConf
Aug 4-6, 2010
Amelia Island, FL
Discount code: WOLF
Rails & Web App
Professionals, Entrepreneurs,
for 43% off
Consultants http://bizconf.org?
Small group coupon=WOLF
Network with Who's Who
Organized by Obie
Fernandez of Hashrocket
Highlight: David Allen