Un profondo punto di vista sul perché Ruby on Rails ha rivoluzionato lo sviluppo web.
Questo talk focalizzerà la sua attenzione sul “Golden Path” di Rails, sui motivi del suo successo, sui problemi più comuni, e su come le sue API possano essere migliorate.
Impareremo a trarre beneficio da uno strumento tanto potente quanto pericoloso, di come mitigare le implicazioni architetturali, di design e testabilità delle vostre applicazioni, migliorando la qualità del codice..
The document discusses test-driven development (TDD). It states that TDD relies on short development cycles where the developer first writes an automated test case that defines a new function or improvement. Then the developer produces code to pass that test, and refactors the new code to acceptable standards.
Jasmine is a BDD framework for testing JavaScript code. It does not depend on other frameworks and does not require a DOM. Jasmine uses specs, expectations, suites, and matchers to define tests and make assertions. It also supports features for testing asynchronous code and spying on functions. Jasmine provides tools like spies, stubs, fakes, and mocks to help test code behavior.
This document provides a summary of Java 8 features including lambdas, functional interfaces, streams, and optional. It discusses lambda expressions and how they allow implementing functional interfaces in a more concise way compared to anonymous classes. Key functional interfaces like Predicate, Function, and Comparator are demonstrated. The document also covers stream operations for processing collections lazily and optionally handling potential null references.
This talk was delivered at JavaOne 2013, together with Andrzej Grzesik. We mention the new Date APIs, changes to Collections as well as Streams APIs and of course... Lambdas!
The document provides an overview of various testing frameworks and libraries that can be used for testing Java code. It discusses frameworks for unit testing like JUnit, Mockito, and Spock. It also covers libraries for integration testing like Arquillian, REST Assured and WireMock. Other topics include parameterizing tests, testing asynchronous code, verifying PDF and XML documents. The document aims to help developers choose the right tools for testing different parts of an application effectively.
Test First Refresh Second: Test-Driven Development in GrailsTim Berglund
Grails provides solid support for unit testing of parts of your application that are usually very difficult to test. Learn how to enable test-first development practices using the Grails framework.
The document discusses test-driven development (TDD). It states that TDD relies on short development cycles where the developer first writes an automated test case that defines a new function or improvement. Then the developer produces code to pass that test, and refactors the new code to acceptable standards.
Jasmine is a BDD framework for testing JavaScript code. It does not depend on other frameworks and does not require a DOM. Jasmine uses specs, expectations, suites, and matchers to define tests and make assertions. It also supports features for testing asynchronous code and spying on functions. Jasmine provides tools like spies, stubs, fakes, and mocks to help test code behavior.
This document provides a summary of Java 8 features including lambdas, functional interfaces, streams, and optional. It discusses lambda expressions and how they allow implementing functional interfaces in a more concise way compared to anonymous classes. Key functional interfaces like Predicate, Function, and Comparator are demonstrated. The document also covers stream operations for processing collections lazily and optionally handling potential null references.
This talk was delivered at JavaOne 2013, together with Andrzej Grzesik. We mention the new Date APIs, changes to Collections as well as Streams APIs and of course... Lambdas!
The document provides an overview of various testing frameworks and libraries that can be used for testing Java code. It discusses frameworks for unit testing like JUnit, Mockito, and Spock. It also covers libraries for integration testing like Arquillian, REST Assured and WireMock. Other topics include parameterizing tests, testing asynchronous code, verifying PDF and XML documents. The document aims to help developers choose the right tools for testing different parts of an application effectively.
Test First Refresh Second: Test-Driven Development in GrailsTim Berglund
Grails provides solid support for unit testing of parts of your application that are usually very difficult to test. Learn how to enable test-first development practices using the Grails framework.
This document provides an overview of Java 8 features such as lambda expressions, streams, and optional. Key points include:
- Java 8 introduced lambda expressions to provide concise syntax for anonymous functions. Common functional interfaces like Predicate and Function are used.
- Streams allow processing collections in a functional way through intermediate and terminal operations like map, filter, collect. They are lazy evaluated and cannot mutate data.
- Optional is a wrapper for values that may be null, avoiding null checks in favor of functional-style operations like orElse, ifPresent.
The Ring programming language version 1.5.3 book - Part 13 of 184Mahmoud Samir Fayed
This document summarizes the new features and changes in Ring 1.5.3. It describes improvements to the Ring Notepad including using QPlainTextEdit, displaying line numbers, and auto-complete functions. It also discusses new classes, functions, and libraries added in this release such as the Form Designer, RingZip library, and ability to embed Ring code without shared state. The document is the release notes for Ring 1.5.3 detailing the updates and enhancements.
Advanced Jasmine - Front-End JavaScript Unit TestingLars Thorup
This document discusses advanced techniques for front-end JavaScript unit testing using Jasmine, including mocking methods, constructors, timers, and AJX requests to test code in isolation without dependencies and speed up tests. It also covers spying on events, simulating CSS transitions, using custom matchers, structuring test code, and browser-specific testing. The presenter is Lars Thorup, a software developer and coach who founded ZeaLake and teaches agile and automated testing.
So you've got testing religion, but the question now is, how do you test your database?
This tutorial introduces pgTAP, a comprehensive, easy-to-use test suite for PostgreSQL. We'll work from getting and installing pgTAP, to writing a simple test, to running the test and integrating it into your test environment. And then we really get into the fun stuff:
Testing scalar values
Testing error conditions and performance regressions
Testing database schemas, including tables, columns, constraints, indexes, triggers, etc.
Testing result sets
Testing procedures
Testing may sound like a dry topic, but my examples aren't! Come join the fun!
Test-Driven Development of AngularJS ApplicationsFITC
The document discusses test driven development for AngularJS applications. It outlines problems with traditional front-end development approaches like jQuery manipulation and lack of structure/modularity. The solution presented uses Node.js, NPM, Bower, Grunt, Jasmine and other tools to automate tasks, add structure and enable testing. Features of an example task tracking app are developed using a test-first approach with end-to-end and unit tests. The app is built incrementally by splitting development into small features and writing tests for each.
What elevates software development into software engineering? In this talk, we’ll make the case that rigorous testing is one of the fundamental ways in which programmers can improve the predictability of the output we produce. We will examine some relatively unknown, or at least not widely adopted, software testing techniques that go beyond basic unit testing to help us deliver complex systems with confidence.
This document provides an overview of Java versions from Java 5 through Java 9 and introduces key features of Java 8 such as lambda expressions, functional interfaces, and streams. The document discusses how lambda expressions allow for more concise implementation of interfaces like Comparator compared to Java 7. It also covers optional, exceptions in lambda expressions, and best practices for writing lambda expressions and using streams in Java 8.
The document discusses how RSpec achieves "zero monkey patching mode" in version 3.0. It describes how RSpec previously extensively used monkey patching but has worked to reduce this in recent versions. It details how RSpec loads spec files, builds example groups and hierarchies, runs examples, and makes expectations without monkey patching core objects or classes. Key aspects covered include the rspec executable, loading files, building example groups, running examples, and the expect-based syntax.
This presentation is prepared for SVCC 2014 on Javascript Testing with Jasmine. It basically goes through basic Jasmine feature and provide tips for developers when they decide to start testing.
A code kata in C# to help practice techniques for safely removing dependencies form legacy code and creating unit tests. Questions? Suggestions? Contact @dubmun.
Having trouble wrapping you mind around unit testing in legacy code? Practice this kata and you'll have a good understanding of some basics. Break dependencies, inject stubs, write meaningful tests. Refactor with confidence. Version 2 is a complete overhaul to make the kata more readable and usable.
The document discusses unit testing and test-driven development. It introduces the QUnit JavaScript testing framework, describing how to write tests and assertions using its API. Key aspects covered include setting up QUnit, the test and assert functions, asynchronous testing, grouping tests into modules, and integrating automated testing with Node and Grunt.
The Ring programming language version 1.8 book - Part 89 of 202Mahmoud Samir Fayed
This document provides an overview of extending the Ring virtual machine (RingVM) using C/C++. It discusses:
1. The ring_ext.h and ring_ext.c files that are used to add new modules to the RingVM. Constants in ring_ext.h control inclusion of modules during builds.
2. The organization of modules, which typically include a header, load function, and functions registered via ring_vm_funcregister().
3. Features of the Ring API used to write extension functions, including parameter handling, return values, and list/string functions.
4. Examples of implementing common functions like sin() and file I/O following this structure
Firebase and ng2
This document discusses Firebase and AngularFire/AngularFire2. It summarizes that Firebase is a backend as a service that provides realtime database functionality. AngularFire/AngularFire2 are wrappers that make the Firebase API accessible to Angular applications. Key features covered include authentication, authorization, data validation, and working with data through observable references and promises. Best practices like shallow data structures and avoiding deep nesting are also highlighted.
This presentation deals with a complex approach to application testing in back end and front end parts, tests writing and common mistakes. It also includes a short overview of libraries and frameworks for creation of tests, as well as practical examples of code.
Presentation by Pavlo Iuriichuk, Lead Software Engineer, GlobalLogic, Kyiv), delivered at an open techtalk on December 11, 2014.
More details - http://globallogic.com.ua/report-web-testing-techtalk-2014
Stop Making Excuses and Start Testing Your JavaScriptRyan Anklam
The document provides tips for adding testing to JavaScript projects. It recommends choosing a testing environment and dialect, then setting up the tests by installing dependencies and configuring files. Common issues like testing asynchronous code and methods that call other methods can be addressed with spies, stubs, mocks and promises. Tests should focus on isolated units of code and avoid direct DOM manipulation when possible. Automating testing through build tools like Grunt and Testem helps to easily run and watch tests. Overall, the document emphasizes making testing easy by writing maintainable, modular code and setting up automation.
This lightning talk discusses replacing threads with actors for making concurrent service calls in web applications. It describes how actors provide an alternative concurrency model that can be more resource efficient than threads. The talk shows how to implement a master/worker pattern using Akka actors to dispatch work to remote services in parallel from a servlet, collecting the responses to render the page. Key advantages of the actor model include easier reasoning about concurrency and built-in supervision to restart failed actors.
A presentation made for the AngularJS-IL meetup group that took place in May 2014 at Google TLV Campus. its a demonstration of Unit testing an AngularJS component with jasmine and karma.
FullStack Reativo com Spring WebFlux + AngularLoiane Groner
This document discusses building a full-stack reactive application using Spring WebFlux for the backend and Angular for the frontend. It covers reactive programming concepts, building a reactive backend with Spring WebFlux, building a reactive frontend with Angular, and integrating the two. The document includes an agenda, descriptions of reactive architecture and programming, examples of reactive applications and services in Spring and Angular, and challenges and references for further information.
The document provides an overview of SOLID principles with examples in Ruby code. It discusses the Single Responsibility Principle (SRP), Open-Closed Principle (OCP), Liskov Substitution Principle (LSP), Interface Segregation Principle (ISP), and Dependency Inversion Principle (DIP). For each principle, it shows code that violates the principle and refactors the code to follow the principle. The document emphasizes that SOLID is difficult and requires practice, and violations often involve multiple principles. It encourages reading books to learn more about applying SOLID in code.
Código Saudável => Programador Feliz - Rs on Rails 2010Plataformatec
Palestra do Rs On Rails, na qual demos algumas dicas de boas práticas para manter seu código mais limpo e ter absoluto controle da sua aplicação em produção.
This document provides an overview of Java 8 features such as lambda expressions, streams, and optional. Key points include:
- Java 8 introduced lambda expressions to provide concise syntax for anonymous functions. Common functional interfaces like Predicate and Function are used.
- Streams allow processing collections in a functional way through intermediate and terminal operations like map, filter, collect. They are lazy evaluated and cannot mutate data.
- Optional is a wrapper for values that may be null, avoiding null checks in favor of functional-style operations like orElse, ifPresent.
The Ring programming language version 1.5.3 book - Part 13 of 184Mahmoud Samir Fayed
This document summarizes the new features and changes in Ring 1.5.3. It describes improvements to the Ring Notepad including using QPlainTextEdit, displaying line numbers, and auto-complete functions. It also discusses new classes, functions, and libraries added in this release such as the Form Designer, RingZip library, and ability to embed Ring code without shared state. The document is the release notes for Ring 1.5.3 detailing the updates and enhancements.
Advanced Jasmine - Front-End JavaScript Unit TestingLars Thorup
This document discusses advanced techniques for front-end JavaScript unit testing using Jasmine, including mocking methods, constructors, timers, and AJX requests to test code in isolation without dependencies and speed up tests. It also covers spying on events, simulating CSS transitions, using custom matchers, structuring test code, and browser-specific testing. The presenter is Lars Thorup, a software developer and coach who founded ZeaLake and teaches agile and automated testing.
So you've got testing religion, but the question now is, how do you test your database?
This tutorial introduces pgTAP, a comprehensive, easy-to-use test suite for PostgreSQL. We'll work from getting and installing pgTAP, to writing a simple test, to running the test and integrating it into your test environment. And then we really get into the fun stuff:
Testing scalar values
Testing error conditions and performance regressions
Testing database schemas, including tables, columns, constraints, indexes, triggers, etc.
Testing result sets
Testing procedures
Testing may sound like a dry topic, but my examples aren't! Come join the fun!
Test-Driven Development of AngularJS ApplicationsFITC
The document discusses test driven development for AngularJS applications. It outlines problems with traditional front-end development approaches like jQuery manipulation and lack of structure/modularity. The solution presented uses Node.js, NPM, Bower, Grunt, Jasmine and other tools to automate tasks, add structure and enable testing. Features of an example task tracking app are developed using a test-first approach with end-to-end and unit tests. The app is built incrementally by splitting development into small features and writing tests for each.
What elevates software development into software engineering? In this talk, we’ll make the case that rigorous testing is one of the fundamental ways in which programmers can improve the predictability of the output we produce. We will examine some relatively unknown, or at least not widely adopted, software testing techniques that go beyond basic unit testing to help us deliver complex systems with confidence.
This document provides an overview of Java versions from Java 5 through Java 9 and introduces key features of Java 8 such as lambda expressions, functional interfaces, and streams. The document discusses how lambda expressions allow for more concise implementation of interfaces like Comparator compared to Java 7. It also covers optional, exceptions in lambda expressions, and best practices for writing lambda expressions and using streams in Java 8.
The document discusses how RSpec achieves "zero monkey patching mode" in version 3.0. It describes how RSpec previously extensively used monkey patching but has worked to reduce this in recent versions. It details how RSpec loads spec files, builds example groups and hierarchies, runs examples, and makes expectations without monkey patching core objects or classes. Key aspects covered include the rspec executable, loading files, building example groups, running examples, and the expect-based syntax.
This presentation is prepared for SVCC 2014 on Javascript Testing with Jasmine. It basically goes through basic Jasmine feature and provide tips for developers when they decide to start testing.
A code kata in C# to help practice techniques for safely removing dependencies form legacy code and creating unit tests. Questions? Suggestions? Contact @dubmun.
Having trouble wrapping you mind around unit testing in legacy code? Practice this kata and you'll have a good understanding of some basics. Break dependencies, inject stubs, write meaningful tests. Refactor with confidence. Version 2 is a complete overhaul to make the kata more readable and usable.
The document discusses unit testing and test-driven development. It introduces the QUnit JavaScript testing framework, describing how to write tests and assertions using its API. Key aspects covered include setting up QUnit, the test and assert functions, asynchronous testing, grouping tests into modules, and integrating automated testing with Node and Grunt.
The Ring programming language version 1.8 book - Part 89 of 202Mahmoud Samir Fayed
This document provides an overview of extending the Ring virtual machine (RingVM) using C/C++. It discusses:
1. The ring_ext.h and ring_ext.c files that are used to add new modules to the RingVM. Constants in ring_ext.h control inclusion of modules during builds.
2. The organization of modules, which typically include a header, load function, and functions registered via ring_vm_funcregister().
3. Features of the Ring API used to write extension functions, including parameter handling, return values, and list/string functions.
4. Examples of implementing common functions like sin() and file I/O following this structure
Firebase and ng2
This document discusses Firebase and AngularFire/AngularFire2. It summarizes that Firebase is a backend as a service that provides realtime database functionality. AngularFire/AngularFire2 are wrappers that make the Firebase API accessible to Angular applications. Key features covered include authentication, authorization, data validation, and working with data through observable references and promises. Best practices like shallow data structures and avoiding deep nesting are also highlighted.
This presentation deals with a complex approach to application testing in back end and front end parts, tests writing and common mistakes. It also includes a short overview of libraries and frameworks for creation of tests, as well as practical examples of code.
Presentation by Pavlo Iuriichuk, Lead Software Engineer, GlobalLogic, Kyiv), delivered at an open techtalk on December 11, 2014.
More details - http://globallogic.com.ua/report-web-testing-techtalk-2014
Stop Making Excuses and Start Testing Your JavaScriptRyan Anklam
The document provides tips for adding testing to JavaScript projects. It recommends choosing a testing environment and dialect, then setting up the tests by installing dependencies and configuring files. Common issues like testing asynchronous code and methods that call other methods can be addressed with spies, stubs, mocks and promises. Tests should focus on isolated units of code and avoid direct DOM manipulation when possible. Automating testing through build tools like Grunt and Testem helps to easily run and watch tests. Overall, the document emphasizes making testing easy by writing maintainable, modular code and setting up automation.
This lightning talk discusses replacing threads with actors for making concurrent service calls in web applications. It describes how actors provide an alternative concurrency model that can be more resource efficient than threads. The talk shows how to implement a master/worker pattern using Akka actors to dispatch work to remote services in parallel from a servlet, collecting the responses to render the page. Key advantages of the actor model include easier reasoning about concurrency and built-in supervision to restart failed actors.
A presentation made for the AngularJS-IL meetup group that took place in May 2014 at Google TLV Campus. its a demonstration of Unit testing an AngularJS component with jasmine and karma.
FullStack Reativo com Spring WebFlux + AngularLoiane Groner
This document discusses building a full-stack reactive application using Spring WebFlux for the backend and Angular for the frontend. It covers reactive programming concepts, building a reactive backend with Spring WebFlux, building a reactive frontend with Angular, and integrating the two. The document includes an agenda, descriptions of reactive architecture and programming, examples of reactive applications and services in Spring and Angular, and challenges and references for further information.
The document provides an overview of SOLID principles with examples in Ruby code. It discusses the Single Responsibility Principle (SRP), Open-Closed Principle (OCP), Liskov Substitution Principle (LSP), Interface Segregation Principle (ISP), and Dependency Inversion Principle (DIP). For each principle, it shows code that violates the principle and refactors the code to follow the principle. The document emphasizes that SOLID is difficult and requires practice, and violations often involve multiple principles. It encourages reading books to learn more about applying SOLID in code.
Código Saudável => Programador Feliz - Rs on Rails 2010Plataformatec
Palestra do Rs On Rails, na qual demos algumas dicas de boas práticas para manter seu código mais limpo e ter absoluto controle da sua aplicação em produção.
The document discusses RSpec, a behavior-driven development (BDD) framework for testing Ruby code. It describes how RSpec allows writing tests in a natural language style using "should" statements. Examples are provided for different types of RSpec tests, including model, controller, and view tests. Shared examples, custom matchers, and integration with Cucumber for writing tests in a storytelling format are also covered. The document concludes with information on installing and running RSpec and generating reports from test results.
The document discusses testing legacy Rails applications. It provides steps to get testing set up on a legacy Rails app, including creating a test database, running migrations, and getting Rake tasks to run tests. It emphasizes starting with one test at a time, finding and fixing bugs, and refactoring code. Examples are given of writing a model test based on application logs and fixing a failure by updating code. The document stresses treating methods as isolated boxes and only testing one thing at a time to incrementally add tests to a legacy codebase.
The document discusses various Ruby concepts including object-oriented programming (OOP), metaprogramming, blocks, iterators, mixins, duck typing, classes, modules, inheritance, include/extend, yield, enumerable, comparable, symbol to proc, transactions, and file handling. It provides code examples to illustrate these concepts.
The document provides guidelines for testing Rails applications. It recommends that any code change should be driven by a failed test. Tests should be close to the code being tested and focus on functionality rather than specific code. It discusses testing models, associations, named scopes, validations, controllers, views, helpers, emails, user interactions, Ajax requests, external sites, Rake tasks, file uploads, legacy applications, and more. The goal is to have tests that result in high-quality code through a test-first approach.
- Ruby is an interactive, object-oriented programming language created by Yukihiro Matsumoto in 1995.
- Ruby on Rails is a web application framework built on Ruby that emphasizes convention over configuration and is optimized for programmer happiness.
- The document discusses Ruby and Ruby on Rails, providing an overview of their history, key principles like MVC, REST, and conventions used in Rails. It also provides examples of modeling data with classes and ActiveRecord in Rails.
Every now and then, we have to write articles about how we've checked another fresh version of some compiler. That's not really much fun. However, as practice shows, if we stop doing that for a while, folks start doubting whether PVS-Studio is worth its title of a good catcher of bugs and vulnerabilities. What if the new compiler can do that too? Sure, compilers evolve, but so does PVS-Studio – and it proves, again and again, its ability to catch bugs even in high-quality projects such as compilers.
Java 7 introduced several new features including underscore in numeric literals to improve readability (e.g. 1_000), binary literals prefixed with "0b", string switching to allow string comparisons, diamond operator <> in collections to simplify generic type instantiation, improved exception handling with multi-catch functionality, automatic resource management with try-with-resources, and new NIO 2.0 APIs including file change notifications. Other enhancements included fork/join framework for parallel programming, dynamic language support improvements, and Swing component decorator JLayer. The presentation proposed upgrading an existing Etrali project to Java 7 for benefits such as improved performance and reduced code size.
This document discusses strategies for migrating legacy data into a Rails application. It covers connecting to the legacy database, retrieving and mapping data with ActiveRecord models, integrating the models, validating data, migrating data with importers, testing the migration process, automating migrations with Rake tasks, and deploying the migration with Capistrano.
Macros are essential in Clojure and are used to provide fundamental operations like "when". Macros receive unevaluated code and return data structures for Clojure to evaluate. Writing macros involves building lists to represent code. Care must be taken to avoid issues like variable capture and double evaluation. While powerful, macros can lead to overly complex code if overused.
On February 18th, 2010 was O'Reilly's "Exploring Rails 3" online conference and these are Gregg Pollack's slides. They are by no means a complete record of improvements in Rails 3, but they should serve to get your appetite wet.
The document discusses Ruby and Ruby on Rails. It notes that Ruby is an object-oriented programming language created by Yukihiro Matsumoto in 1995. Ruby on Rails is a web application framework built on Ruby that was created by David Heinemeier Hansson in 2004. It follows the model-view-controller architectural pattern, separating applications into models, views, and controllers.
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.
JavaScript Cheatsheets with easy way .pdfranjanadeore1
The document provides information about JavaScript keywords and variables, data types, built-in objects, and the DOM. It explains that var, let, and const can be used to declare variables, with var providing function scope, let providing block scope, and const providing block scope and preventing reassignment. The document also summarizes functions, operators, conditional statements, loops, and other core JavaScript concepts.
The document provides an introduction and overview of ES6, React, and Redux. It begins with an in-depth section about new features and syntax in ES6, including variable types, arrow functions, modules, classes, and more. It then discusses React, explaining concepts like the virtual DOM, one-way data flow, JSX syntax, props, nested components, conditionals, and state/setState. Finally, it briefly introduces Redux and mentions using React components on the server and in mobile apps with React Native.
The way JavaScript is standardized and improved is changing this year. Learning how will help you understand why transpilers have become so popular, and why we will likely be using them for a long time.
Ember itself will need to adapt to changes in JavaScript, and we will take a look at how the existing object model might be migrated to a pure EcmaScript solution.
Troubleshooting tips from docker support engineersDocker, Inc.
Docker makes everything easier. But even with the easiest platforms, sometimes you run into problems. In this session, you'll learn first-hand from someone whose job is helping customers fix these problems. In this session, you'll learn how to:
Ask better questions & identify the real problems you want to solve
Use command line tools to inspect internal Swarm and Kubernetes components
Debug and troubleshoot interactions between Enterprise Edition components
Troubleshoot Docker Enterprise Edition Windows nodes
Apply these skills to troubleshooting Docker Enterprise Edition
Fundamental Concepts of React JS for Beginners.pdfStephieJohn
React is a JavaScript library for building user interfaces using components. Components are reusable pieces of code that present UI and can be functions or classes. Class components provide key functions like state that function components lack. Components break down complex UIs into independent and reusable pieces. The document then covers fundamental React concepts like getting started, component structure, state, rendering components, and the component lifecycle.
Fuzz-testing: A hacker's approach to making your code more secure | Pascal Ze...Codemotion
Increased complexity makes it very hard and time-consuming to keep your software bug-free and secure. We introduce fuzz-testing as a method for automatically and continuously discovering vulnerabilities hidden in your code. The talk will explain how fuzzing works and how to integrate fuzz-testing into your Software Development Life Cycle to increase your code’s security.
Pompili - From hero to_zero: The FatalNoise neverending storyCodemotion
It was 1993 when we decided to venture in a beat'em up game for Amiga. The Catalypse's success story pushed me and my comrade to create something astonishing for this incredible game machine... but things went harder, assumptions were slightly different, and italian competitors appeared out of nowhere... the project died in 1996. Story ended? Probably not...
Il Commodore 65 è un prototipo di personal computer che Commodore avrebbe dovuto mettere in commercio quale successore del Commodore 64. Purtroppo la sua realizzazione si fermò appunto allo stadio prototipale. Racconterò l'affascinante storia del suo sviluppo ed il perchè della soppressione del progetto ormai ad un passo dalla immissione in commercio.
Rivivere l'ebbrezza di progettare un vecchio computer o una consolle da bar è oggi possibile sfruttando le FPGA, ovvero logiche programmabili che consentono a chiunque di progettare il proprio hardware o di ricrearne uno del passato. In questa sessione si racconta come dal reverse engineering dell'hardware di vecchie glorie come il Commodore 64 e lo ZX Spectrum sia stato possibile farle rivivere attraverso tecnologie oggi alla portata di tutti.
Michel Schudel - Let's build a blockchain... in 40 minutes! - Codemotion Amst...Codemotion
There's a lot of talk about blockchain, but how does the technology behind it actually work? For developers, getting some hands-on experience is the fastest way to get familiair with new technologies. So let's build a blockchain, then! In this session, we're going to build one in plain old Java, and have it working in 40 minutes. We'll cover key concepts of a blockchain: transactions, blocks, mining, proof-of-work, and reaching consensus in the blockchain network. After this session, you'll have a better understanding of core aspects of blockchain technology.
Richard Süselbeck - Building your own ride share app - Codemotion Amsterdam 2019Codemotion
When was the last time you were truly lost? Thanks to the maps and location technology in our phones, a whole generation has now grown up in a world where getting lost is truly a thing of the past. Location technology goes far beyond maps in the palm of our hand, however. In this talk, we will explore how a ridesharing app works. How do we discover our destination?How do we find the closest driver? How do we display this information on a map? How do we find the best route?To answer these questions,we will be learning about a variety of location APIs, including Maps, Positioning, Geocoding etc.
Eward Driehuis - What we learned from 20.000 attacks - Codemotion Amsterdam 2019Codemotion
Eward Driehuis, SecureLink's research chief, will guide you through the bumpy ride we call the cyber threat landscape. As the industry has over a decade of experience of dealing with increasingly sophisticated attacks, you might be surprised to hear more attacks slip through the cracks than ever. From analyzing 20.000 of them in 2018, backed by a quarter of a million security events and over ten trillion data points, Eward will outline why this happens, how attacks are changing, and why it doesn't matter how neatly or securely you code.
Francesco Baldassarri - Deliver Data at Scale - Codemotion Amsterdam 2019 - Codemotion
IoT revolution is ended. Thanks to hardware improvement, building an intelligent ecosystem is easier than never before for both startups and large-scale enterprises. The real challenge is now to connect, process, store and analyze data: in the cloud, but also, at the edge. We’ll give a quick look on frameworks that aggregate dispersed devices data into a single global optimized system allowing to improve operational efficiency, to predict maintenance, to track asset in real-time, to secure cloud-connected devices and much more.
Martin Förtsch, Thomas Endres - Stereoscopic Style Transfer AI - Codemotion A...Codemotion
What if Virtual Reality glasses could transform your environment into a three-dimensional work of art in realtime in the style of a painting from Van Gogh? One of the many interesting developments in the field of Deep Learning is the so called "Style Transfer". It describes a possibility to create a patchwork (or pastiche) from two images. While one of these images defines the the artistic style of the result picture, the other one is used for extracting the image content. A team from TNG Technology Consulting managed to build an AI showcase using OpenCV and Tensorflow to realize such goggles.
Melanie Rieback, Klaus Kursawe - Blockchain Security: Melting the "Silver Bul...Codemotion
The document summarizes some of the security issues with blockchain technology. It discusses how blockchain is not a "silver bullet" and does not inherently solve problems like privacy and security of smart devices. It outlines various application security issues with complex code, protocols, and difficulty of updates on blockchains. Concerns over data immutability and security of smart contracts are also covered. The document questions whether blockchain truly provides the level of decentralization and anonymity claimed, and outlines some impossibility results and limitations of existing approaches to achieving security and privacy in blockchain systems.
Angelo van der Sijpt - How well do you know your network stack? - Codemotion ...Codemotion
The document provides an overview of the HTTP network protocol in its early stages of development. It summarizes the initial IMP (Interface Message Processor) software used to establish connections and transmit messages over the ARPANET. It outlines some early requirements for host-to-host software to enable simple and advanced use between computer systems. The document also describes the initial host software specifications, including establishing connections, transmitting data efficiently, and implementing error checking between connected systems. This was one of the first documents to define core aspects of the early HTTP network protocol to enable information exchange over the fledgling internet.
Lars Wolff - Performance Testing for DevOps in the Cloud - Codemotion Amsterd...Codemotion
Performance tests are not only an important instrument for understanding a system and its runtime environment. It is also essential in order to check stability and scalability – non-functional requirements that might be decisive for success. But won't my cloud hosting service scale for me as long as I can afford it? Yes, but… It only operates and scales resources. It won't automatically make your system fast, stable and scalable. This talk shows how such and comparable questions can be clarified with performance tests and how DevOps teams benefit from regular test practise.
Sascha Wolter - Conversational AI Demystified - Codemotion Amsterdam 2019Codemotion
Sascha will demonstrate the opportunities and challenges of Conversational AI learned from the practice. Both Technology and User Experience will be covered introducing a process finding micro-moments, writing happy paths, gathering intents, designing the conversational flow, and finally publishing on almost all channels including Voice Services and Chatbots. Valuable for enterprises, developers, and designers. All live on stage in just minutes and with almost no code.
Michele Tonutti - Scaling is caring - Codemotion Amsterdam 2019Codemotion
A key challenge we face at Pacmed is quickly calibrating and deploying our tools for clinical decision support in different hospitals, where data formats may vary greatly. Using Intensive Care Units as a case study, I’ll delve into our scalable Python pipeline, which leverages Pandas’ split-apply-combine approach to perform complex feature engineering and automatic quality checks on large time-varying data, e.g. vital signs. I’ll show how we use the resulting flexible and interpretable dataframes to quickly (re)train our models to predict mortality, discharge, and medical complications.
Pat Hermens - From 100 to 1,000+ deployments a day - Codemotion Amsterdam 2019Codemotion
Coolblue is a proud Dutch company, with a large internal development department; one that truly takes CI/CD to heart. Empowerment through automation is at the heart of these development teams, and with more than 1000 deployments a day, we think it's working out quite well. In this session, Pat Hermens (a Development Managers) will step you through what enables us to move so quickly, which tools we use, and most importantly, the mindset that is required to enable development teams to deliver at such a rapid pace.
James Birnie - Using Many Worlds of Compute Power with Quantum - Codemotion A...Codemotion
Quantum computers can use all of the possible pathways generated by quantum decisions to solve problems that will forever remain intractable to classical compute power. As the mega players vie for quantum supremacy and Rigetti announces its $1M "quantum advantage" prize, we live in exciting times. IBM-Q and Microsoft Q# are two ways you can learn to program quantum computers so that you're ready when the quantum revolution comes. I'll demonstrate some quantum solutions to problems that will forever be out of reach of classical, including organic chemistry and large number factorisation.
Don Goodman-Wilson - Chinese food, motor scooters, and open source developmen...Codemotion
Chinese food exploded across America in the early 20th century, rapidly adapting to local tastes while also spreading like wildfire. How was it able to spread so fast? The GY6 is a family of scooter engines that has achieved near total ubiquity in Europe. It is reliable and cheap to manufacture, and it's made in factories across China. How are these factories able to remain afloat? Chinese-American food and the GY6 are both riveting studies in product-market fit, and both are the product of a distributed open source-like development model. What lessons can we learn for open source software?
Pieter Omvlee - The story behind Sketch - Codemotion Amsterdam 2019Codemotion
The design space has exploded in size within the last few years and Sketch is one of the most important milestones to represent the phenomenon. But behind the scenes of this growing reality there is a remote team that revolutionizes the design space all without leaving the home office. This talk will present how Sketch has grown to become a modern, product designer's tool.
Dave Farley - Taking Back “Software Engineering” - Codemotion Amsterdam 2019Codemotion
Would you fly in a plane designed by a craftsman or would you prefer your aircraft to be designed by engineers? We are learning that science and empiricism works in software development, maybe now is the time to redefine what “Software Engineering” really means. Software isn't bridge-building, it is not car or aircraft development either, but then neither is Chemical Engineering. Engineering is different in different disciplines. Maybe it is time for us to begin thinking about retrieving the term "Software Engineering" maybe it is time to define what our "Engineering" discipline should be.
Joshua Hoffman - Should the CTO be Coding? - Codemotion Amsterdam 2019Codemotion
What is the job of a CTO and how does it change as a startup grows in size and scale? As a CTO, where should you spend your focus? As an engineer aspiring to be a CTO, what skills should you pursue? In this inspiring and personal talk, I describe my journey from early Red Hat engineer to CTO at Bloomon. I will share my view on what it means to be a CTO, and ultimately answer the question: Should the CTO be coding?
Discover top-tier mobile app development services, offering innovative solutions for iOS and Android. Enhance your business with custom, user-friendly mobile applications.
Digital Banking in the Cloud: How Citizens Bank Unlocked Their MainframePrecisely
Inconsistent user experience and siloed data, high costs, and changing customer expectations – Citizens Bank was experiencing these challenges while it was attempting to deliver a superior digital banking experience for its clients. Its core banking applications run on the mainframe and Citizens was using legacy utilities to get the critical mainframe data to feed customer-facing channels, like call centers, web, and mobile. Ultimately, this led to higher operating costs (MIPS), delayed response times, and longer time to market.
Ever-changing customer expectations demand more modern digital experiences, and the bank needed to find a solution that could provide real-time data to its customer channels with low latency and operating costs. Join this session to learn how Citizens is leveraging Precisely to replicate mainframe data to its customer channels and deliver on their “modern digital bank” experiences.
Connector Corner: Seamlessly power UiPath Apps, GenAI with prebuilt connectorsDianaGray10
Join us to learn how UiPath Apps can directly and easily interact with prebuilt connectors via Integration Service--including Salesforce, ServiceNow, Open GenAI, and more.
The best part is you can achieve this without building a custom workflow! Say goodbye to the hassle of using separate automations to call APIs. By seamlessly integrating within App Studio, you can now easily streamline your workflow, while gaining direct access to our Connector Catalog of popular applications.
We’ll discuss and demo the benefits of UiPath Apps and connectors including:
Creating a compelling user experience for any software, without the limitations of APIs.
Accelerating the app creation process, saving time and effort
Enjoying high-performance CRUD (create, read, update, delete) operations, for
seamless data management.
Speakers:
Russell Alfeche, Technology Leader, RPA at qBotic and UiPath MVP
Charlie Greenberg, host
Freshworks Rethinks NoSQL for Rapid Scaling & Cost-EfficiencyScyllaDB
Freshworks creates AI-boosted business software that helps employees work more efficiently and effectively. Managing data across multiple RDBMS and NoSQL databases was already a challenge at their current scale. To prepare for 10X growth, they knew it was time to rethink their database strategy. Learn how they architected a solution that would simplify scaling while keeping costs under control.
"Choosing proper type of scaling", Olena SyrotaFwdays
Imagine an IoT processing system that is already quite mature and production-ready and for which client coverage is growing and scaling and performance aspects are life and death questions. The system has Redis, MongoDB, and stream processing based on ksqldb. In this talk, firstly, we will analyze scaling approaches and then select the proper ones for our system.
Fueling AI with Great Data with Airbyte WebinarZilliz
This talk will focus on how to collect data from a variety of sources, leveraging this data for RAG and other GenAI use cases, and finally charting your course to productionalization.
HCL Notes and Domino License Cost Reduction in the World of DLAUpanagenda
Webinar Recording: https://www.panagenda.com/webinars/hcl-notes-and-domino-license-cost-reduction-in-the-world-of-dlau/
The introduction of DLAU and the CCB & CCX licensing model caused quite a stir in the HCL community. As a Notes and Domino customer, you may have faced challenges with unexpected user counts and license costs. You probably have questions on how this new licensing approach works and how to benefit from it. Most importantly, you likely have budget constraints and want to save money where possible. Don’t worry, we can help with all of this!
We’ll show you how to fix common misconfigurations that cause higher-than-expected user counts, and how to identify accounts which you can deactivate to save money. There are also frequent patterns that can cause unnecessary cost, like using a person document instead of a mail-in for shared mailboxes. We’ll provide examples and solutions for those as well. And naturally we’ll explain the new licensing model.
Join HCL Ambassador Marc Thomas in this webinar with a special guest appearance from Franz Walder. It will give you the tools and know-how to stay on top of what is going on with Domino licensing. You will be able lower your cost through an optimized configuration and keep it low going forward.
These topics will be covered
- Reducing license cost by finding and fixing misconfigurations and superfluous accounts
- How do CCB and CCX licenses really work?
- Understanding the DLAU tool and how to best utilize it
- Tips for common problem areas, like team mailboxes, functional/test users, etc
- Practical examples and best practices to implement right away
Essentials of Automations: Exploring Attributes & Automation ParametersSafe Software
Building automations in FME Flow can save time, money, and help businesses scale by eliminating data silos and providing data to stakeholders in real-time. One essential component to orchestrating complex automations is the use of attributes & automation parameters (both formerly known as “keys”). In fact, it’s unlikely you’ll ever build an Automation without using these components, but what exactly are they?
Attributes & automation parameters enable the automation author to pass data values from one automation component to the next. During this webinar, our FME Flow Specialists will cover leveraging the three types of these output attributes & parameters in FME Flow: Event, Custom, and Automation. As a bonus, they’ll also be making use of the Split-Merge Block functionality.
You’ll leave this webinar with a better understanding of how to maximize the potential of automations by making use of attributes & automation parameters, with the ultimate goal of setting your enterprise integration workflows up on autopilot.
Programming Foundation Models with DSPy - Meetup SlidesZilliz
Prompting language models is hard, while programming language models is easy. In this talk, I will discuss the state-of-the-art framework DSPy for programming foundation models with its powerful optimizers and runtime constraint system.
In the realm of cybersecurity, offensive security practices act as a critical shield. By simulating real-world attacks in a controlled environment, these techniques expose vulnerabilities before malicious actors can exploit them. This proactive approach allows manufacturers to identify and fix weaknesses, significantly enhancing system security.
This presentation delves into the development of a system designed to mimic Galileo's Open Service signal using software-defined radio (SDR) technology. We'll begin with a foundational overview of both Global Navigation Satellite Systems (GNSS) and the intricacies of digital signal processing.
The presentation culminates in a live demonstration. We'll showcase the manipulation of Galileo's Open Service pilot signal, simulating an attack on various software and hardware systems. This practical demonstration serves to highlight the potential consequences of unaddressed vulnerabilities, emphasizing the importance of offensive security practices in safeguarding critical infrastructure.
AppSec PNW: Android and iOS Application Security with MobSFAjin Abraham
Mobile Security Framework - MobSF is a free and open source automated mobile application security testing environment designed to help security engineers, researchers, developers, and penetration testers to identify security vulnerabilities, malicious behaviours and privacy concerns in mobile applications using static and dynamic analysis. It supports all the popular mobile application binaries and source code formats built for Android and iOS devices. In addition to automated security assessment, it also offers an interactive testing environment to build and execute scenario based test/fuzz cases against the application.
This talk covers:
Using MobSF for static analysis of mobile applications.
Interactive dynamic security assessment of Android and iOS applications.
Solving Mobile app CTF challenges.
Reverse engineering and runtime analysis of Mobile malware.
How to shift left and integrate MobSF/mobsfscan SAST and DAST in your build pipeline.
5th LF Energy Power Grid Model Meet-up SlidesDanBrown980551
5th Power Grid Model Meet-up
It is with great pleasure that we extend to you an invitation to the 5th Power Grid Model Meet-up, scheduled for 6th June 2024. This event will adopt a hybrid format, allowing participants to join us either through an online Mircosoft Teams session or in person at TU/e located at Den Dolech 2, Eindhoven, Netherlands. The meet-up will be hosted by Eindhoven University of Technology (TU/e), a research university specializing in engineering science & technology.
Power Grid Model
The global energy transition is placing new and unprecedented demands on Distribution System Operators (DSOs). Alongside upgrades to grid capacity, processes such as digitization, capacity optimization, and congestion management are becoming vital for delivering reliable services.
Power Grid Model is an open source project from Linux Foundation Energy and provides a calculation engine that is increasingly essential for DSOs. It offers a standards-based foundation enabling real-time power systems analysis, simulations of electrical power grids, and sophisticated what-if analysis. In addition, it enables in-depth studies and analysis of the electrical power grid’s behavior and performance. This comprehensive model incorporates essential factors such as power generation capacity, electrical losses, voltage levels, power flows, and system stability.
Power Grid Model is currently being applied in a wide variety of use cases, including grid planning, expansion, reliability, and congestion studies. It can also help in analyzing the impact of renewable energy integration, assessing the effects of disturbances or faults, and developing strategies for grid control and optimization.
What to expect
For the upcoming meetup we are organizing, we have an exciting lineup of activities planned:
-Insightful presentations covering two practical applications of the Power Grid Model.
-An update on the latest advancements in Power Grid -Model technology during the first and second quarters of 2024.
-An interactive brainstorming session to discuss and propose new feature requests.
-An opportunity to connect with fellow Power Grid Model enthusiasts and users.
Conversational agents, or chatbots, are increasingly used to access all sorts of services using natural language. While open-domain chatbots - like ChatGPT - can converse on any topic, task-oriented chatbots - the focus of this paper - are designed for specific tasks, like booking a flight, obtaining customer support, or setting an appointment. Like any other software, task-oriented chatbots need to be properly tested, usually by defining and executing test scenarios (i.e., sequences of user-chatbot interactions). However, there is currently a lack of methods to quantify the completeness and strength of such test scenarios, which can lead to low-quality tests, and hence to buggy chatbots.
To fill this gap, we propose adapting mutation testing (MuT) for task-oriented chatbots. To this end, we introduce a set of mutation operators that emulate faults in chatbot designs, an architecture that enables MuT on chatbots built using heterogeneous technologies, and a practical realisation as an Eclipse plugin. Moreover, we evaluate the applicability, effectiveness and efficiency of our approach on open-source chatbots, with promising results.
"Frontline Battles with DDoS: Best practices and Lessons Learned", Igor IvaniukFwdays
At this talk we will discuss DDoS protection tools and best practices, discuss network architectures and what AWS has to offer. Also, we will look into one of the largest DDoS attacks on Ukrainian infrastructure that happened in February 2022. We'll see, what techniques helped to keep the web resources available for Ukrainians and how AWS improved DDoS protection for all customers based on Ukraine experience
6. Why Rails
has revolutionized web
development?
Convention Over
Config uration
(IMHO)
:)
7. Why Rails
has revolutionized web
development?
Dynamic and innovative
Convention Over
Config uration
ecosystem
(IMHO)
:)
8. Why Rails
has revolutionized web
development?
Dynamic and innovative
Convention Over
Productivity and
Developer uration
Config Happiness
ecosystem
(IMHO)
:)
15. Active
Record
Encapsulation violations
1 if article.statearticle.published?
1 unless != 'published'
2 article.update_attribute(state: 'published')
2 article.publish!
3 end 3 end
4 # not completely right...
16. Active
Record
Encapsulation violations
1 if article.statearticle.published?
1 unless != 'published'
2 article.update_attribute(state: 'published')
2 article.publish!
3 end 3 end
4 # not completely right...
17. Active
Record
Encapsulation violations
1 if article.statearticle.published?
1 unless != 'published'
2 article.update_attribute(state: 'published')
2 article.publish!
3 end 3 end
4 # not completely right...
18. Active
Record
Tell, Don’t Ask
1
2 violations
article.publish!
unless article.published?
# article.publish!
push the implementation
3 end
# into the model
4 # not completely right...
19. Active
Record
Tell, Don’t Ask
violations
1 article.publish!
unless article.published?
2 # article.publish!
push the implementation
3 end
# into the model
4 # not completely right...
20. Active
Record
Tell, Don’t Ask
violations
1 article.publish!
unless article.published?
2 # article.publish!
push the implementation
3 end
# into the model
4 # not completely right...
21. Active
Record
2
Implicit vs Explicit API
1 class Post < ActiveRecord::Base
1 Post.where(state:'published').
1 Post.most_recent_published
def self.most_recent_published(limit = 5)
3 2published.recent(limit).order('created_at DESC')
order('created_at DESC').
4 end
5 3 limit(5)
6 private
7 scope :published, ->() { where(state: 'published') }
8 scope :recent, ->(n) { limit(n) }
9 end
22. Active
Record
Implicit vs Explicit API
1 class Post < ActiveRecord::Base
2 1 Post.where(state:'published').
1 Post.most_recent_published
def self.most_recent_published(limit = 5)
3 2published.recent(limit).order('created_at DESC')
order('created_at DESC').
4 end
5 3 limit(5)
6 private
7 scope :published, ->() { where(state: 'published') }
8 scope :recent, ->(n) { limit(n) }
9 end
23. Active
Record
Implicit vs Explicit API
1 class Post < ActiveRecord::Base
2 1 Post.where(state:'published').
1 Post.most_recent_published
def self.most_recent_published(limit = 5)
3 2published.recent(limit).order('created_at DESC')
order('created_at DESC').
4 end
5 3 limit(5)
6 private
7 scope :published, ->() { where(state: 'published') }
8 scope :recent, ->(n) { limit(n) }
9 end
24. Active
Record
Implicit vs Explicit API
1 class Post < ActiveRecord::Base
2 1 Post.where(state:'published').
1 Post.most_recent_published
def self.most_recent_published(limit = 5)
3 2published.recent(limit).order('created_at DESC')
order('created_at DESC').
4 end
5 3 limit(5)
6 private
7 scope :published, ->() { where(state: 'published') }
8 scope :recent, ->(n) { limit(n) }
9 end
25. Active
Record
Callbacks abuse
Non-persistence logic is
tight to the persistence
life cycle.
Eg. Sending emails
26. Active
Record
Testability issues
Micheal Feathers
27. Active
Record
A test is not a unit test if it talks
Testability issues
to a database.
Micheal Feathers
28. Action
Controller
Action
Controller
It doesn’t affect too much your
architecture, but it has strange
OOP design.
29. Action
Controller
1 class PostsController < ApplicationController
2 before_filter :authenticate
Frankenstein Controllers
3
4 def new
5 end
6
7 def create
8 @post = Post.new(params[:post])
9
10 if @post.save
11 redirect_to post_url(@post), notice: 'Yay!'
12 else
13 render :new
14 end
15 end
16 end
30. Action
Controller
Frankenstein Controllers
1 class PostsController < ApplicationController
2 before_filter :authenticate
3
4 def new
5 end
6
7 def create
8 @post = Post.new(params[:post])
9
10 if @post.save
11 redirect_to post_url(@post), notice: 'Yay!'
12 else
13 render :new
14 end
15 end
16 end
31. Action
Controller
Frankenstein Controllers
1 class PostsController < ApplicationController
2 before_filter :authenticate
3
4 def new
5 end
6
7 def create
8 @post = Post.new(params[:post])
9
10 if @post.save
11 redirect_to post_url(@post), notice: 'Yay!'
12 else
13 render :new
14 end
15 end
16 end
32. Action
Controller
Frankenstein Controllers
1 class PostsController < ApplicationController
2 before_filter :authenticate
3
4 def new
5 end
6
7 def create
8 @post = Post.new(params[:post])
9
10 if @post.save
11 redirect_to post_url(@post), notice: 'Yay!'
12 else
13 render :new
14 end
15 end
16 end
33. Action
Controller
Frankenstein Controllers
1 class PostsController < ApplicationController
2 before_filter :authenticate
3
4 def new
5 end
6
7 def create
8 @post = Post.new(params[:post])
9
10 if @post.save
11 redirect_to post_url(@post), notice: 'Yay!'
12 else
13 render :new
14 end
15 end
16 end
34. Action
Controller
Frankenstein Controllers
1 class PostsController < ApplicationController
2 before_filter :authenticate
3
4 def new
5 end
6
7 def create
8 @post = Post.new(params[:post])
9
10 if @post.save
11 redirect_to post_url(@post), notice: 'Yay!'
12 else
13 render :new
14 end
15 end
16 end
35. Action
Controller
1 class PostsController < ApplicationController
2 # ...
Odd classes
3
4 def create
5 @post = Post.new(params[:post])
6
7 if @post.save
8 # ...
9 else
10 # ...
11 end
12 end
13 end
36. Action
Controller
Odd classes
1 class PostsController < ApplicationController
2 # ...
3
4 def create
5 @post = Post.new(params[:post])
6
7 if @post.save
8 # ...
9 else
10 # ...
11 end
12 end
13 end
37. Action
Controller
Odd classes
1 class PostsController < ApplicationController
2 # ...
3
4 def create
5 @post = Post.new(params[:post])
6
7 if @post.save
8 # ...
9 else
10 # ...
11 end
12 end
13 end
38. Action
Controller
Odd classes
1 class PostsController < ApplicationController
2 # ...
3
4 def create
5 @post = Post.new(params[:post])
6
7 if @post.save
8 # ...
9 else
10 # ...
11 end
12 end
13 end
39. Action
Controller
3
4
Encapsulation violations
1 class PostsController < ApplicationController
2 # ...
def create
5 @post = Post.new(params[:post])
6 # ...
7 end
8 end
40. Action
Controller
Encapsulation violations
1 class PostsController < ApplicationController
2 # ...
3
4 def create
5 @post = Post.new(params[:post])
6 # ...
7 end
8 end
41. Action
Controller
1 describe PostsController do
Testability issues
2 it 'assigns @posts' do
3 Post.should_receive(:most_recent_published).
4 and_return(posts = [mock])
5 get :index
6
7 expect(assigns(:posts)).to eq(posts)
8 end
9 end
42. Action
Controller
Testability issues
1 describe PostsController do
2 it 'assigns @posts' do
3 Post.should_receive(:most_recent_published).
4 and_return(posts = [mock])
5 get :index
6
7 expect(assigns(:posts)).to eq(posts)
8 end
9 end
43. Action
Controller
Testability issues
1 describe PostsController do
2 it 'assigns @posts' do
3 Post.should_receive(:most_recent_published).
4 and_return(posts = [mock])
5 get :index
6
7 expect(assigns(:posts)).to eq(posts)
8 end
9 end
44. Action
Controller
Testability issues
1 describe PostsController do
2 it 'assigns @posts' do
3 Post.should_receive(:most_recent_published).
4 and_return(posts = [mock])
5 get :index
6
7 expect(assigns(:posts)).to eq(posts)
8 end
9 end
45. Action
Controller
Testability issues
1 describe PostsController do
2 it 'assigns @posts' do
3 Post.should_receive(:most_recent_published).
4 and_return(posts = [mock])
5 get :index
6
7 expect(assigns(:posts)).to eq(posts)
8 end
9 end
46. Action
Controller
Testability issues
1 describe PostsController do
2 it 'assigns @posts' do
3 Post.should_receive(:most_recent_published).
4 and_return(posts = [mock])
5 get :index
6
7 expect(assigns(:posts)).to eq(posts)
8 end
9 end
48. Action
View
Views aren’t views
(but templates with logic)
Without “real” views (or In an ideal world we
presenters), we’re tempted to shouldn’t test our
push presentational methods templates.
into the models.
49. Action
View
Helpers are
functional programming
1 def user_full_name(user)
2 [ user.first_name, user.last_name ].join(' ')
3 end
4
5 url_for
6 # vs Half-assed way to solve
7 Url.for presentational problems in
8 ActionView.
9 posts_url
50. Action
View
Helpers are
functional programming
1 def user_full_name(user)
2 [ user.first_name, user.last_name ].join(' ')
3 end
4
5 url_for
6 # vs Half-assed way to solve
7 Url.for presentational problems in
8 ActionView.
9 posts_url
58. Solutions
Keep methods and
accessors private as
much as possible.
Public APIs are hard to
maintain as the codebase
and the team grows.
59. Solutions
Skinny controllers
and
skinny models.
Use ser vice objects or DCI, they
are easier and faster to test.
60. Solutions
Don’t be afraid to extract
ad-hoc classes for
specific responsibilities.
Inner classes are your friends,
they help you with details, and
aren’t part of your public API.
65. me@lucag uidi.com
@jodosha
https://speakerdeck.com/jodosha/a-rails-criticism
Except where otherwise noted, this work is licensed under:
http://creativecommons.org/licenses/by-nc-sa/3.0/