Software metrics can provide useful insights into code quality and complexity. Code metrics like lines of code, cyclomatic complexity, and weighted method count measure characteristics like code size, logic complexity, and class complexity. Design metrics evaluate qualities like coupling and cohesion. Metrics are most effective when used to identify improvement opportunities rather than to judge the overall quality of code or designs. Calculating and tracking metrics over time can help optimize code and catch regressions during development.
Static Optimization of PHP bytecode (PHPSC 2017)Nikita Popov
This document discusses static optimization of PHP bytecode. It describes optimizations like constant propagation, dead code elimination, inlining, and specialization that have been implemented in PHP. It also discusses challenges to optimization from features like references, eval(), and variable variables. Type inference using static single assignment form is explained. Metrics on performance improvements from optimizations in libraries and applications like WordPress are provided. Current and future work on additional optimizations in PHP is mentioned.
Creating Domain Specific Languages in PythonSiddhi
This document discusses domain specific languages (DSLs) and provides examples of creating DSLs in Python. It explains that DSLs allow users to work in specialized mini-languages tailored to specific problem domains. As examples, it discusses SQL as a DSL for databases and regular expressions as a DSL for patterns. It then demonstrates how to create an external DSL for defining forms using PyParsing and an internal DSL for the same using Python features like metaclasses. The document concludes that DSLs make code easier to read, write and maintain for non-programmers.
You might have heard of Domain-Driven Design. You may have heard DDD is a tool to write readable and change-ready code. You may have even heard DDD comes with a lot of talking, and modeling, and customers...
Starting with DDD sounds big, and scary, doesn't it?
But getting started is not scary. Come find out what DDD can do for your code, today! We'll use value objects, entities and services to bring order to our mind and code. We'll see how naming things can guide us, but also trick us. We'll rework a piece of code together and improve what it means. And tomorrow you can tell your peers that, technically, you're doing DDD.
Paulo Morgado presented an overview of new features in C# 6.0. Some key points:
- The .NET Compiler Platform ("Roslyn") reimplements the C# and VB compilers in C# with public APIs.
- New C# 6.0 features include auto-property initializers, primary constructors, string interpolation, null propagation, expression-bodied members, and await in catch/finally blocks.
- Many features are still being implemented or considered for inclusion in C# 6.0 based on the April 2014 preview release.
- The presentation demonstrated examples of the new C# 6.0 language features and their syntax. Attendees were encouraged to try
Не так давно вышел C# 6, основанный на новом компиляторе Roslyn. Обновление языка содержит большое количество приятных синтаксических конструкций, которые упрощают написание кода и делают его более лаконичным. Но Microsoft на этом не успокоились: прямо сейчас ведётся работа над 7-ой версией языка, которую планируют сделать ещё удобнее, благодаря реализации современных тенденций написания кода. В этом докладе мы поговорим о том, что может войти в C# 7. В числе прочего будут обсуждаться Tuples, Pattern matching, Records / algebraic data types, Nullability tracking и многое другое.
PHP 8.0 is expected to be released by the end of the year, so it’s time to take a first look at the next major version of PHP. Attributes, union types, and a just-in-time compiler are likely the flagship features of this release, but there are many more improvements to be excited about. As PHP 8.0 is a major version, this release also includes backwards-incompatible changes, many of which are centered around stricter error handling and more type safety.
This talk will discuss new features already implemented in PHP 8, backwards-compatibility breaks to watch out for, as well as some features that are still under discussion.
Davide Cerbo - Kotlin: forse è la volta buona - Codemotion Milan 2017 Codemotion
Dopo 20 anni Java inizia a sentire il peso degli anni e la sua sintassi non evolve come vorremmo, ma la JVM resta sempre un ambiente affidabile ed è già in produzione presso moltissime aziende. Negli ultimi anni sono usciti molti linguaggi basati sulla JVM, ma non tutti hanno avuto il successo sperato. Kotlin ha conquistato Android e, ora, grazie a una sintassi intuitiva e grandi aziende che lo supportano potrebbe essere molto utilizzato anche nelle applicazioni web. Durante il talk vedremo le basi del linguaggio e come sviluppare una applicazione web pronta ad andare in produzione.
Static Optimization of PHP bytecode (PHPSC 2017)Nikita Popov
This document discusses static optimization of PHP bytecode. It describes optimizations like constant propagation, dead code elimination, inlining, and specialization that have been implemented in PHP. It also discusses challenges to optimization from features like references, eval(), and variable variables. Type inference using static single assignment form is explained. Metrics on performance improvements from optimizations in libraries and applications like WordPress are provided. Current and future work on additional optimizations in PHP is mentioned.
Creating Domain Specific Languages in PythonSiddhi
This document discusses domain specific languages (DSLs) and provides examples of creating DSLs in Python. It explains that DSLs allow users to work in specialized mini-languages tailored to specific problem domains. As examples, it discusses SQL as a DSL for databases and regular expressions as a DSL for patterns. It then demonstrates how to create an external DSL for defining forms using PyParsing and an internal DSL for the same using Python features like metaclasses. The document concludes that DSLs make code easier to read, write and maintain for non-programmers.
You might have heard of Domain-Driven Design. You may have heard DDD is a tool to write readable and change-ready code. You may have even heard DDD comes with a lot of talking, and modeling, and customers...
Starting with DDD sounds big, and scary, doesn't it?
But getting started is not scary. Come find out what DDD can do for your code, today! We'll use value objects, entities and services to bring order to our mind and code. We'll see how naming things can guide us, but also trick us. We'll rework a piece of code together and improve what it means. And tomorrow you can tell your peers that, technically, you're doing DDD.
Paulo Morgado presented an overview of new features in C# 6.0. Some key points:
- The .NET Compiler Platform ("Roslyn") reimplements the C# and VB compilers in C# with public APIs.
- New C# 6.0 features include auto-property initializers, primary constructors, string interpolation, null propagation, expression-bodied members, and await in catch/finally blocks.
- Many features are still being implemented or considered for inclusion in C# 6.0 based on the April 2014 preview release.
- The presentation demonstrated examples of the new C# 6.0 language features and their syntax. Attendees were encouraged to try
Не так давно вышел C# 6, основанный на новом компиляторе Roslyn. Обновление языка содержит большое количество приятных синтаксических конструкций, которые упрощают написание кода и делают его более лаконичным. Но Microsoft на этом не успокоились: прямо сейчас ведётся работа над 7-ой версией языка, которую планируют сделать ещё удобнее, благодаря реализации современных тенденций написания кода. В этом докладе мы поговорим о том, что может войти в C# 7. В числе прочего будут обсуждаться Tuples, Pattern matching, Records / algebraic data types, Nullability tracking и многое другое.
PHP 8.0 is expected to be released by the end of the year, so it’s time to take a first look at the next major version of PHP. Attributes, union types, and a just-in-time compiler are likely the flagship features of this release, but there are many more improvements to be excited about. As PHP 8.0 is a major version, this release also includes backwards-incompatible changes, many of which are centered around stricter error handling and more type safety.
This talk will discuss new features already implemented in PHP 8, backwards-compatibility breaks to watch out for, as well as some features that are still under discussion.
Davide Cerbo - Kotlin: forse è la volta buona - Codemotion Milan 2017 Codemotion
Dopo 20 anni Java inizia a sentire il peso degli anni e la sua sintassi non evolve come vorremmo, ma la JVM resta sempre un ambiente affidabile ed è già in produzione presso moltissime aziende. Negli ultimi anni sono usciti molti linguaggi basati sulla JVM, ma non tutti hanno avuto il successo sperato. Kotlin ha conquistato Android e, ora, grazie a una sintassi intuitiva e grandi aziende che lo supportano potrebbe essere molto utilizzato anche nelle applicazioni web. Durante il talk vedremo le basi del linguaggio e come sviluppare una applicazione web pronta ad andare in produzione.
The document discusses the Just-In-Time (JIT) compiler that was introduced in PHP 8. It provides a brief history of JIT in PHP, explaining that early prototypes showed that the rest of PHP was too slow to benefit from JIT. It then discusses how optimizations from JIT were integrated into opcache without needing a full JIT. It provides information on configuring and using the JIT compiler, and shows performance improvements on benchmarks. It also provides an example of how a function is compiled to machine code by the JIT compiler.
В последнее время экосистема .NET развивается очень динамично: постоянно появляются новые технологии и инструменты, а старые обзаводятся новыми возможностями. Уследить за всем очень сложно, поэтому в этом докладе мы постараемся обзорно взглянуть на текущее состояние платформы .NET, а также на то, что нас ждёт в ближайшем будущем. Будем говорить про грядущий C#7, про кроссплатформенность и нативную компиляцию, про новый .NET Core 5 и ASP.NET 5, про новые инструменты для разработчиков и последние анонсы от Microsoft.
This document provides an overview of arrays, generics, wildcards, and lambda expressions in Java. It discusses array initialization and multi-dimensional arrays. It explains generics and how they avoid type casting. It covers wildcard types, subclass/superclass constraints, and limitations of generics. The document also demonstrates lambda expressions and functional interfaces like Comparator. It provides examples of common data structures in Java like List, Set, and Map as well as streams and iterators.
Graph databases come with enhanced connectivity of data and whiteboard friendly paradigm. It requires learning a new Graph Traversal Language, that crawls the network and brings informations. It's indeed a fresh new look at how we store web of data and search for it. We'll meet gremlin, from Apache TinkerPop, which provides an abstract layer that make it easy to express your business logic without fighting with the code, and several Open Source graph databases, available for testing and toying.
Lucio Floretta - TensorFlow and Deep Learning without a PhD - Codemotion Mila...Codemotion
With TensorFlow, deep machine learning transitions from an area of research to mainstream software engineering. In this session, we'll work together to construct and train a neural network that recognises handwritten digits. Along the way, we'll discover some of the "tricks of the trade" used in neural network design, and finally, we'll bring the recognition accuracy of our model above 99%.
Following a game show format made popular by Joshua Bloch and Neal Gafter's Java Puzzlers this presentation intends to both entertain and inform. Snippets of Python code the whose behaviour is not entirely obvious are shown, the audience will then be asked to pick from a number of options what the behaviour of the program is. The correct and sometimes non-intuitive answer will then be given along with a brief explanation of the idea the puzzle exposes. Only a modest working knowledge of the Python language is required to understand the puzzles, but the puzzles may also entertain the more experienced Python programmer.
The document discusses implementing CQRS and event sourcing patterns using RavenDB for persistence. It begins with an example employee management prototype and identifies issues with the initial approach. It then explores improving the model by defining commands, events, and having entities generate events in response to commands. Events are stored in RavenDB to rebuild entity state and allow queries to be answered from the event stream. The document provides examples of handling commands, generating and applying events, and saving events to documents in RavenDB.
Great Scott! C# 7 is almost out!
Time to hop into the DeLorean with Doc Brown. If my calculations are correct, when this baby hits 88 miles per hour, we'll be traveling back to the future with C# 7. Switches? Where we're going, we don't need Switches we got Pattern Matching. Just hold on for one second. Let's get this straight, in the future Tuples will be usable! This will beg the questions. Where are we? When are we? We are in the future and we now have Local Functions and Records.
You'll walk away with a sense of where C# is going and how you can learn about its new features today by looking back to the future. This is heavy.
This document provides an overview of PHP (Hypertext Preprocessor), a popular server-side scripting language used for web development. It discusses key PHP concepts like server-side scripting, inclusion of files, syntax, variables, arrays, operators, functions, branching, looping, forms, MySQL integration, sessions, and cookies. The document is intended to help beginners get started with PHP.
O quanto você está satisfeito com o código que produz? Mais ainda: o quanto você está satisfeito como profissional? Na busca pela melhoria de nossas aplicações, caímos num grande desafio: melhorar a nós mesmos!
Numa conversa franca e descontraída, Samuel e Victor tentarão apresentar idéias sobre como você pode melhorar seu próprio trabalho e sentir orgulho do que faz.
The document summarizes new features in C# 7 including:
- Literal improvements such as digit separators in integers and hexadecimal/binary literals.
- Expression-bodied members for constructors, destructors, getters and setters.
- Throw expressions to throw exceptions inline without using exceptions.
- Out variables, pattern matching, tuples, and local functions.
- Ref returns and locals for passing by reference.
- Generalized async return types beyond Task/Task<T> using custom awaiters.
The document contains examples of C++ code demonstrating the use of vectors, lists, and deques. It includes code inserting, erasing, and iterating over elements. Functions like push_back(), pop_front(), begin(), end() etc. are used. Structures are defined containing lists and vectors. Elements are added and removed from the lists and vectors and their sizes printed.
This document compares and contrasts the programming languages Perl and Haskell. It discusses their differences in terms of being dynamic vs static, imperative vs functional, and weakly vs strongly typed. It provides examples of how similar tasks like mapping, doubling values, and finding lengths can be accomplished in both languages. It also explores some of the challenges that arise from Perl's scalar/list context and Haskell's use of monads and strong static types. Overall, the document examines the different philosophies behind Perl and Haskell while also showing how influences have flowed between the communities over time.
The document is a presentation on PHP classes and object-oriented programming. It defines key concepts like classes, objects, methods, and attributes. It provides an example dog class with bark() and name attributes. It demonstrates how to define a class, create objects from a class, and call methods. The presentation also covers inheritance, class scope, constructors, and deleting objects. It discusses reasons for using object-oriented programming like code reuse and maintenance.
The document summarizes new features in C# 6, including improvements to auto-properties like initializers and read-only properties, expression-bodied function members, the 'using static' directive, the null-conditional operator, string interpolation, 'nameof' expressions, collection and index initializers, exception filters, 'await' in catch/finally blocks, and C# Interactive. It provides code examples to demonstrate each new feature and references additional resources for more information.
TDC2016POA | Trilha .NET - CQRS e ES na prática com RavenDBtdc-globalcode
The document discusses implementing CQRS and event sourcing patterns using RavenDB for persistence. It begins with a simple employee management prototype and evolves it to use domain-driven design principles like separating commands from queries and modeling entities to emit domain events in response to state changes. The events are stored as documents in RavenDB and are used to update entity state and project read models. It also covers loading entities from their event streams and saving event streams back to documents in the database.
The document discusses different types of data members and member functions in classes in C++, including constant, mutable, and static data members, as well as constant, static, overloaded, and inline member functions. It provides examples of how to declare and use these various data members and member functions. It also covers topics like constant member functions, static data members, nested member functions, friend functions and classes, array of objects, and passing objects to functions by value, reference, and pointer.
This document provides a summary of a term paper on modern programming tools. It discusses a fee management system project that was developed using Java. The project aims to manage student fee data for educational institutes. It allows administrators to set fees, view fees owed by students, and has features like being secure, easy to use, and reliable. The document includes details of the coding for the various Java classes used in the project like the main class, student class, administrator class, and classes for login, viewing/updating student details, and adding new students.
SimpleVOC OPEN – Yet another Memcached? (Froscon 2010 talk, german)triagens
Zur Zeit existieren viele, verschiedene Key/Value-Datenbanken. Neben dem Urvater “memcached” gibt es kompatible Produkte, wie beispielsweise Redis, oder Neuentwicklungen ala Dynamo oder Riak. Warum sollte man also eine weitere Key/Value-Datenbank bauen? Der Vortrag beschreibt, aus welchen Bausteine eine solche Datenbank besteht, warum HTTP/JSON zur Zeit die Protokolle der Wahl sind, und warum man Dank des Satzes von Brewer (aka CAP Theorem) manchmal nicht alles haben kann.
Der Vortrag erklärt zum einen das CAP Theorem, untersucht wie dies in memcached umgesetzt ist und welche Verbesserungen möglich sind. Zum anderen wird SimpleVOC OPEN beschrieben, eine OpenSource C++-Anwendungen mit den Protokollen des Web (HTTP, JSON). Der SimpleVOC OPEN stellt eine Key/Value-Datenbank zur Verfügung, welche als memcached Ersatz dienen kann. Im Gegensatz zu umfangreicheren Lösungen, wie beispielsweise Redis, versucht der SimpleVOC OPEN sich auf das Wesentliche zu konzentrieren, nämlich der Speicherung von Key/Value-Paaren im Hauptspeicher. Es werden die verschiedenen Komponenten beschrieben, welche benötigt werden, um einen Web 2.0 Server bereitzustellen. Dabei handelt es sich um einen I/O-Scheduler, einen einfachen HTTP-Server, einen JSON-Parser sowie eine InMemory-Datenbank.
The document discusses one click deployment with Jenkins. It describes how Jenkins can be used as a centralized build server to run continuous integration and testing. This allows developers to easily deploy new changes with a single click. The document advocates for practices like continuous integration, inspection and deployment to enable faster release cycles.
The document discusses the Just-In-Time (JIT) compiler that was introduced in PHP 8. It provides a brief history of JIT in PHP, explaining that early prototypes showed that the rest of PHP was too slow to benefit from JIT. It then discusses how optimizations from JIT were integrated into opcache without needing a full JIT. It provides information on configuring and using the JIT compiler, and shows performance improvements on benchmarks. It also provides an example of how a function is compiled to machine code by the JIT compiler.
В последнее время экосистема .NET развивается очень динамично: постоянно появляются новые технологии и инструменты, а старые обзаводятся новыми возможностями. Уследить за всем очень сложно, поэтому в этом докладе мы постараемся обзорно взглянуть на текущее состояние платформы .NET, а также на то, что нас ждёт в ближайшем будущем. Будем говорить про грядущий C#7, про кроссплатформенность и нативную компиляцию, про новый .NET Core 5 и ASP.NET 5, про новые инструменты для разработчиков и последние анонсы от Microsoft.
This document provides an overview of arrays, generics, wildcards, and lambda expressions in Java. It discusses array initialization and multi-dimensional arrays. It explains generics and how they avoid type casting. It covers wildcard types, subclass/superclass constraints, and limitations of generics. The document also demonstrates lambda expressions and functional interfaces like Comparator. It provides examples of common data structures in Java like List, Set, and Map as well as streams and iterators.
Graph databases come with enhanced connectivity of data and whiteboard friendly paradigm. It requires learning a new Graph Traversal Language, that crawls the network and brings informations. It's indeed a fresh new look at how we store web of data and search for it. We'll meet gremlin, from Apache TinkerPop, which provides an abstract layer that make it easy to express your business logic without fighting with the code, and several Open Source graph databases, available for testing and toying.
Lucio Floretta - TensorFlow and Deep Learning without a PhD - Codemotion Mila...Codemotion
With TensorFlow, deep machine learning transitions from an area of research to mainstream software engineering. In this session, we'll work together to construct and train a neural network that recognises handwritten digits. Along the way, we'll discover some of the "tricks of the trade" used in neural network design, and finally, we'll bring the recognition accuracy of our model above 99%.
Following a game show format made popular by Joshua Bloch and Neal Gafter's Java Puzzlers this presentation intends to both entertain and inform. Snippets of Python code the whose behaviour is not entirely obvious are shown, the audience will then be asked to pick from a number of options what the behaviour of the program is. The correct and sometimes non-intuitive answer will then be given along with a brief explanation of the idea the puzzle exposes. Only a modest working knowledge of the Python language is required to understand the puzzles, but the puzzles may also entertain the more experienced Python programmer.
The document discusses implementing CQRS and event sourcing patterns using RavenDB for persistence. It begins with an example employee management prototype and identifies issues with the initial approach. It then explores improving the model by defining commands, events, and having entities generate events in response to commands. Events are stored in RavenDB to rebuild entity state and allow queries to be answered from the event stream. The document provides examples of handling commands, generating and applying events, and saving events to documents in RavenDB.
Great Scott! C# 7 is almost out!
Time to hop into the DeLorean with Doc Brown. If my calculations are correct, when this baby hits 88 miles per hour, we'll be traveling back to the future with C# 7. Switches? Where we're going, we don't need Switches we got Pattern Matching. Just hold on for one second. Let's get this straight, in the future Tuples will be usable! This will beg the questions. Where are we? When are we? We are in the future and we now have Local Functions and Records.
You'll walk away with a sense of where C# is going and how you can learn about its new features today by looking back to the future. This is heavy.
This document provides an overview of PHP (Hypertext Preprocessor), a popular server-side scripting language used for web development. It discusses key PHP concepts like server-side scripting, inclusion of files, syntax, variables, arrays, operators, functions, branching, looping, forms, MySQL integration, sessions, and cookies. The document is intended to help beginners get started with PHP.
O quanto você está satisfeito com o código que produz? Mais ainda: o quanto você está satisfeito como profissional? Na busca pela melhoria de nossas aplicações, caímos num grande desafio: melhorar a nós mesmos!
Numa conversa franca e descontraída, Samuel e Victor tentarão apresentar idéias sobre como você pode melhorar seu próprio trabalho e sentir orgulho do que faz.
The document summarizes new features in C# 7 including:
- Literal improvements such as digit separators in integers and hexadecimal/binary literals.
- Expression-bodied members for constructors, destructors, getters and setters.
- Throw expressions to throw exceptions inline without using exceptions.
- Out variables, pattern matching, tuples, and local functions.
- Ref returns and locals for passing by reference.
- Generalized async return types beyond Task/Task<T> using custom awaiters.
The document contains examples of C++ code demonstrating the use of vectors, lists, and deques. It includes code inserting, erasing, and iterating over elements. Functions like push_back(), pop_front(), begin(), end() etc. are used. Structures are defined containing lists and vectors. Elements are added and removed from the lists and vectors and their sizes printed.
This document compares and contrasts the programming languages Perl and Haskell. It discusses their differences in terms of being dynamic vs static, imperative vs functional, and weakly vs strongly typed. It provides examples of how similar tasks like mapping, doubling values, and finding lengths can be accomplished in both languages. It also explores some of the challenges that arise from Perl's scalar/list context and Haskell's use of monads and strong static types. Overall, the document examines the different philosophies behind Perl and Haskell while also showing how influences have flowed between the communities over time.
The document is a presentation on PHP classes and object-oriented programming. It defines key concepts like classes, objects, methods, and attributes. It provides an example dog class with bark() and name attributes. It demonstrates how to define a class, create objects from a class, and call methods. The presentation also covers inheritance, class scope, constructors, and deleting objects. It discusses reasons for using object-oriented programming like code reuse and maintenance.
The document summarizes new features in C# 6, including improvements to auto-properties like initializers and read-only properties, expression-bodied function members, the 'using static' directive, the null-conditional operator, string interpolation, 'nameof' expressions, collection and index initializers, exception filters, 'await' in catch/finally blocks, and C# Interactive. It provides code examples to demonstrate each new feature and references additional resources for more information.
TDC2016POA | Trilha .NET - CQRS e ES na prática com RavenDBtdc-globalcode
The document discusses implementing CQRS and event sourcing patterns using RavenDB for persistence. It begins with a simple employee management prototype and evolves it to use domain-driven design principles like separating commands from queries and modeling entities to emit domain events in response to state changes. The events are stored as documents in RavenDB and are used to update entity state and project read models. It also covers loading entities from their event streams and saving event streams back to documents in the database.
The document discusses different types of data members and member functions in classes in C++, including constant, mutable, and static data members, as well as constant, static, overloaded, and inline member functions. It provides examples of how to declare and use these various data members and member functions. It also covers topics like constant member functions, static data members, nested member functions, friend functions and classes, array of objects, and passing objects to functions by value, reference, and pointer.
This document provides a summary of a term paper on modern programming tools. It discusses a fee management system project that was developed using Java. The project aims to manage student fee data for educational institutes. It allows administrators to set fees, view fees owed by students, and has features like being secure, easy to use, and reliable. The document includes details of the coding for the various Java classes used in the project like the main class, student class, administrator class, and classes for login, viewing/updating student details, and adding new students.
SimpleVOC OPEN – Yet another Memcached? (Froscon 2010 talk, german)triagens
Zur Zeit existieren viele, verschiedene Key/Value-Datenbanken. Neben dem Urvater “memcached” gibt es kompatible Produkte, wie beispielsweise Redis, oder Neuentwicklungen ala Dynamo oder Riak. Warum sollte man also eine weitere Key/Value-Datenbank bauen? Der Vortrag beschreibt, aus welchen Bausteine eine solche Datenbank besteht, warum HTTP/JSON zur Zeit die Protokolle der Wahl sind, und warum man Dank des Satzes von Brewer (aka CAP Theorem) manchmal nicht alles haben kann.
Der Vortrag erklärt zum einen das CAP Theorem, untersucht wie dies in memcached umgesetzt ist und welche Verbesserungen möglich sind. Zum anderen wird SimpleVOC OPEN beschrieben, eine OpenSource C++-Anwendungen mit den Protokollen des Web (HTTP, JSON). Der SimpleVOC OPEN stellt eine Key/Value-Datenbank zur Verfügung, welche als memcached Ersatz dienen kann. Im Gegensatz zu umfangreicheren Lösungen, wie beispielsweise Redis, versucht der SimpleVOC OPEN sich auf das Wesentliche zu konzentrieren, nämlich der Speicherung von Key/Value-Paaren im Hauptspeicher. Es werden die verschiedenen Komponenten beschrieben, welche benötigt werden, um einen Web 2.0 Server bereitzustellen. Dabei handelt es sich um einen I/O-Scheduler, einen einfachen HTTP-Server, einen JSON-Parser sowie eine InMemory-Datenbank.
The document discusses one click deployment with Jenkins. It describes how Jenkins can be used as a centralized build server to run continuous integration and testing. This allows developers to easily deploy new changes with a single click. The document advocates for practices like continuous integration, inspection and deployment to enable faster release cycles.
Der rasante Aufstieg von Kanban in der Softwareentwicklung führt häufig zu einem überflüssigen Glaubenskrieg mit Scrum, dabei haben beide Methoden ihre individuellen Stärken und Schwächen. Welche sind das und ist für manche Einsatzgebiete eine der beiden Methoden besser geeignet? Lassen sich womöglich sogar beide Vorgehensweisen miteinander kombinieren?
With all the technical considerations of designing and shipping PHP-based software, it's easy to forget how every line of code you write can have a direct impact on your customers. Almost any code has the potential to shape the user experience and result in repeat custom or an over-subscribed helpdesk. Allow Drew McLellan to take you through the lessons learned when building Perch - a PHP content management system that banks heavily on providing a great user experience. Hear what has worked, what failed miserably, and how a goal of eliminating all support requests has driven the technical design of the product.
Effective Localisation for Websites is important. See How TYPO3 supports flexible Localisation and Translationworkflows: Online and Offline Translation, Localisation through Visibility and Fallbacksettings, Translationagency connection.
Verlernte Agilität - Schleichende Fehler in agilen ProzessenSebastian Bauer
Bei der Einführung von Scrum wird oft übersehen, welche Grundsätze fundamental wichtig sind, damit Scrum funktioniert. Aber auch in eingespielten Teams schleichen sich mit der Routine Fehler ein, die die Erfolge des Teams gefährden können. Die Session soll zeigen, wie das Daily Scrum nicht zur nutzlosen Pflicht wird und wie man Retrospektiven nutzt, um schleichende Fehler zu identifizieren.
Open a window, see the clouds - php|tek 2011Rafael Dohms
Is your application ready to take off into the cloud? What does this mean? What do you need to worry about? What frameworks and tools do you need to look at and what new concepts do you need to put in your PHP toolbox to prepare? Get acquainted with Microsoft Azure's platform and features, and discover what tools and frameworks are ready to benefit from this new paradigm.
This document discusses software complexity metrics like cyclomatic complexity and N-path complexity. It provides examples of calculating these metrics for code samples and discusses how they can be used to measure complexity at the method, class, and project level. Tools are introduced that can automatically calculate these metrics for codebases, like PHPLOC and PDepend, which can help identify parts of code that are complex or hard to test. Maintaining low complexity and high test coverage over time can help improve code quality and reliability.
The document discusses virtual functions, which allow for polymorphism in C++ by implementing the "one interface, multiple methods" philosophy. A virtual function declared in a base class can be overridden in derived classes. Abstract base classes contain at least one pure virtual function and cannot be instantiated. Virtual base classes are used to resolve issues that can arise with multiple inheritance. Friend functions can access private members of classes they are declared as friends to.
This document discusses functional programming concepts in PHP like pure functions, higher-order functions, and recursion. It provides examples of mapping, folding, and partial function application. Modularization with functional programming encourages decomposing problems into smaller parts and recomposing them with lazy evaluation and higher-order functions to reduce complexity.
The document provides an overview of JavaScript for PHP developers. It discusses similarities and differences between JavaScript and PHP syntax, including variables, arrays, conditionals, loops, functions, objects, prototypes, and more. It also summarizes the built-in JavaScript API, including global functions, constructors, and properties and methods of objects like Object, Array, Function, String, Number, Math, Date, and Error.
This document provides examples of unit testing code in PHP using PHPUnit. It demonstrates how to write test cases with assertions, use PHPUnit features like data providers and expected exceptions, and addresses challenges like external dependencies by implementing dependency injection. Mocking and stubs are also presented as ways to isolate code during testing. The overall content aims to explain PHPUnit and best practices for writing clean, isolated and effective unit tests.
This talk is an overview of the history of the PHP language and major framework projects that have emerged in the last 5 years. It examines what we've learned in the development of these frameworks, how that education has been brought to bear in Lithium. Most of this talk ended up being me demoing and answering questions, so there's not a lot of content in the slides, sorry.
The document discusses various linters and formatting tools for Clojure code including cljfmt for formatting, eastwood for linting, and kibit for checking idioms. It provides examples of issues each tool can detect and how to integrate them into a project using Leiningen aliases to run checks with `lein lint`. Finally, it briefly mentions some other quality tools and resources for writing clean Clojure code.
This document provides an overview of JavaScript for PHP developers. It compares the syntax and core concepts between the two languages. Some of the key points covered include: variables and data types are similar, functions are objects in JavaScript, JavaScript uses prototypes instead of classes, and functions provide scope. The document also summarizes the built-in global functions and properties, common methods for objects like Array and String, and emphasizes that constructor functions are often not needed in JavaScript.
Note: slightly updated version of these slides are: http://www.slideshare.net/IanBarber/document-classification-in-php-slight-return
This talk discusses how PHP and open source tools can be used to group and classify data for a whole host of applications, including information retrieval, data mining and more.
PHP 7 – What changed internally? (PHP Barcelona 2015)Nikita Popov
The document discusses optimizations made in PHP 7 to improve performance. Some key points:
- PHP 7 optimized how values and objects are stored in memory by removing unnecessary overhead like reference counting. This reduces memory usage and indirection.
- Arrays were optimized to reduce the number of allocations, size, and lookup indirections compared to PHP 5.
- Objects saw reduced allocations, size and indirection for property values in PHP 7.
- Other optimizations included using 64-bit integers, improving immutable array performance, and enhancing the virtual machine to better manage function call stacks.
This document introduces Gutscript, a new programming language designed for PHP developers that aims to address perceived issues with PHP syntax and semantics. Gutscript code compiles to PHP, allowing reuse of existing PHP libraries. It uses a simpler, more concise syntax inspired by languages like Ruby and Perl. The document provides examples comparing Gutscript and PHP code, demonstrating how Gutscript addresses issues like verbose function definitions, complex namespaces, and inconsistent syntax. It also discusses the Go-based implementation and opportunities for optimization of compiled Gutscript code.
PHP 7 – What changed internally? (Forum PHP 2015)Nikita Popov
One of the main selling points of PHP 7 is greatly improved performance, with many real-world applications now running twice as fast… But where do these improvements come from?
At the core of PHP 7 lies an engine rewrite with focus on improving memory usage and performance. This talk provides an overview of the most significant changes, briefly covering everything from data structure changes, over enhancements in the executor, to the new compiler implementation.
This document summarizes the history and future of PHP. It discusses the creators of PHP (Rasmus Lerdorf, Zeev Suraski, John Morris) and outlines the major versions released from PHP 1.0 in 1995 to the upcoming PHP 8.0, which will include features like FFI, JIT compilation, and asynchronous programming. It also previews potential features for future PHP versions such as OpCache core improvements and extending the instanceof operator.
Why async and functional programming in PHP7 suck and how to get overr it?Lucas Witold Adamus
This presentation describes basic issues related to functional programming with PHP and solution for most of problems served by the library called PhpSlang.
Some key points:
- PHP is an easy to read and learn scripting language but is interpreted and suffers from weak typing, making it slower than compiled languages like C++.
- The HipHop Compiler transforms PHP code and syntax into equivalent C++ code. This allows the code to be compiled by g++ for native execution, gaining significant performance improvements over PHP's interpreter.
- The compiler handles dynamic features like functions, variables, and classes through techniques like static binding, global symbol tables, and dynamic dispatch tables to map PHP elements to their C++ equivalents.
- Issues like weak
Mirror, mirror on the wall: Building a new PHP reflection library (DPC 2016)James Titcumb
Have you ever used PHP's built in reflection, only to find you can't do quite what you wanted? What about finding types for parameters or properties? What about reflecting on classes that aren't loaded, so that you can modify them directly?
Better Reflection is an awesome new library that uses magical time-warp techniques* (*actual magic or time-warp not guaranteed) to improve on PHP's built-in reflection by providing additional functionality. In this talk we'll cover what reflection is all about, explore the cool features of Better Reflection already implemented, the difficulties we faced actually writing the thing, and how you can use Better Reflection in your projects to maximise your reflection-fu.
In this talk, we'll explore some of the tools available for measuring software quality. We'll dive into some of the theory behind the metrics that they analyze while looking at some real world applications of those metrics. We'll also explore how to use these tools to gain valuable insight into legacy codebases.
Similar to PHP Benelux 2012: Magic behind the numbers. Software metrics in practice (20)
The document discusses the journey of implementing continuous integration (CI) practices. It describes initial frustrations with ad hoc builds and lack of standards. A council was formed including managers and developers to address threats, opportunities and plan implementation. Automation tools were adopted, including Cruisecontrol, PHPUnit, phpDocumentor, PHP_Codesniffer, and others to enable automated builds, testing, documentation and metrics. Jenkins was later adopted for its improved installation, configuration and support for multiple languages. SonarQube was also used for continuous analysis and quality management. Implementing a CI culture involved adopting development models, scaling the build process, code reviews and improving communication.
CodeClub - Teaching the young generation programmingSebastian Marek
Code Club is all about connecting talented computer programmers with their local schools and providing them with the materials they need to help kids learn to code. It is a nationwide network of free volunteer-led after-school coding clubs for children aged 9-11. In this talk I will tell you what this is all about and how you can get involved and support this great initiative.
Wbrew powszechnym opiniom, nie tak prosto jest zrobić dobre Code Review. Robione w pośpiechu, tylko po to by je "odbębnić", często stwarza więcej szkody niż pożytku. Opowiem wam dlaczego code review jest ważne i jak wykorzystać ten proces aby upewnić się, że napisany kod jest najwyższej jakości. Będę nie tylko mówił o tym kto powinien robić code reviews, i dla kogo, jakie informacje są potrzebne do przeprowadzenia skutecznego code review, ale także jak zrobić dobre code review w najkrótszym możliwym czasie.
Managing and Monitoring Application PerformanceSebastian Marek
Writing your application is one thing. Making the application to perform well is another. We usually forget there is somebody else on the other side of the screen, that becomes very frustrated and upset when he needs to wait until this one page finally loads. It requires a lot of experience to predict specific behaviour and to know what kind of things to avoid. And even with that there is so many different factors that can affect the end user experience. During this talk I will talk about tools and techniques you can use to measure and monitor your application performance.
Software engineering is not an easy profession. You have to constantly learn new things to improve your coding skills and make sure you produce better and cleaner code over time. It’s not difficult, but you have to be aware of a few basic principles. With them in mind you will feel a better engineer and will gain respect from your fellow engineers. And the Lord said: “Thou shall always remember to write unit tests - no matter the deadline. Remember to keep the build green. Thou shall commit often and with meaningful messages (...)”
Continuous Inspection: Fight back the 7 deadly sins of a developer!Sebastian Marek
This document discusses continuous inspection as a way for developers to fight against the seven deadly sins of development. It introduces each of the seven deadly sins - lust, gluttony, greed, sloth, wrath, envy, and pride - and provides examples of how they may manifest in code. It then discusses how tools like Sonar can help with continuous inspection by analyzing code for potential issues and tracking metrics over time to control technical debt.
Test your code like a pro - PHPUnit in practiceSebastian Marek
The day you realised that you can’t really tell what your code does is the day you stop being an amateur programmer and you turn into a professional developer. During this workshop you will learn about the most famous unit testing framework – PHPUnit, how it can help you gain confidence in your code and what to do (and what to avoid) to make your code testable. We will discuss unit testing best practices and talk about tools that can help you automate the whole process, so it becomes more of a habit then a necessity.
It’s not easy to perform a good code review. Often done in a hurry just to get it done, it only makes things worse. People treat it as an obstacle, not a helpful thing. I am gonna tell you why code reviews are important and how they can help you maintain good quality code. I will not only tell who are the code reviews for, how to raise a useful code review, but also how to perform a good code review in the quickest time possible.
Code reviews are a powerful tool in ensuring and maintaining quality in your application, but they can be very difficult to get right. When they're misunderstood or poorly executed, they can even make a bad situation worse.
In this session I'll use my professional experience to give you some tactics for getting great benefit from code reviews. We'll talk about tools, about process and most importantly about attitude! Whether you're a developer or a technical lead, come along and find out how to perform a genuinely useful code review and provide constructive feedback in the quickest time possible.
PHP Forum Paris 2012: Magic behind the numbers. Software metrics in practiceSebastian Marek
We use static code analysis tools more often these days that create great reports and funky graphs. But do we understand what it all means?
Software metrics tends to be magic numbers for a lot of people, but they don’t really have to be. Seb will introduce you to a few basic, the most popular software metrics and tools. He will explain to you what they mean and how you can use them to produce better software.
Software engineering is not an easy profession. You have to constantly learn new things to improve your coding skills and make sure you produce better and cleaner code over time. It's not difficult, but you have to be aware of a few basic principles. With them in mind you will feel a better engineer and will gain respect from your fellow engineers. And the Lord said: "Thou shall always remember to write unit tests - no matter the deadline. Remember to keep the build green. Thou shall commit often and with meaningful messages (...)"
Magic behind the numbers - software metrics in practiceSebastian Marek
We use static code analysis tools more often these days that create great reports and funky graphs. But do we understand what it all mean?
Software metrics tends to be magic numbers for a lot of people, but they don't really have to be. Let me introduce you to a few basic and
most popular software metric and tools and explain you what they mean and how you can use them to produce better software.
Unit testing involves testing individual units of code to ensure they function as intended. Unit tests isolate and test each part of a program to show they are correct. Benefits of unit testing include finding problems early, facilitating change, simplifying integration, and serving as living documentation. PHPUnit is a popular unit testing framework for PHP, which can be installed via PEAR. Tests are written to make assertions and test exceptions, data, and dependencies. Results can be logged in verbose mode or testdox format.
There are several tools out there that help to develop and maintain high quality PHP code. They allow you to identify the most fragile and messy parts of your codebase. PHP_CodeSniffer tokenises PHP, JavaScript and CSS files and detects violations of a defined set of coding standards. Learn how it works, how you can use it and how can you bend it to meet your requirements!
Sonar is a platform for continuously inspecting code quality to detect issues, ensure technical debt is under control, and monitor code complexity, duplications, and potential bugs. It provides visual reporting across projects and allows tracking metrics over time. Sonar supports PHP projects using tools like PHP_Codesniffer, PHPUnit, PHP Depend, and PHP Mess Detector. It can be set up with Maven and integrated with Hudson via a plugin or phpUnderControl via Ant tasks to run analysis as part of the continuous integration build process.
The document discusses using vfsStream to mock the filesystem in unit tests. vfsStream provides a virtual filesystem that uses PHP streams, allowing tests to manipulate files and directories without interacting with the real filesystem. It describes how to set up vfsStream, create and interact with virtual files and directories, and a vfsStream PHPUnit helper that simplifies its integration with PHPUnit tests.
Introduction of Cybersecurity with OSS at Code Europe 2024Hiroshi SHIBATA
I develop the Ruby programming language, RubyGems, and Bundler, which are package managers for Ruby. Today, I will introduce how to enhance the security of your application using open-source software (OSS) examples from Ruby and RubyGems.
The first topic is CVE (Common Vulnerabilities and Exposures). I have published CVEs many times. But what exactly is a CVE? I'll provide a basic understanding of CVEs and explain how to detect and handle vulnerabilities in OSS.
Next, let's discuss package managers. Package managers play a critical role in the OSS ecosystem. I'll explain how to manage library dependencies in your application.
I'll share insights into how the Ruby and RubyGems core team works to keep our ecosystem safe. By the end of this talk, you'll have a better understanding of how to safeguard your code.
Dandelion Hashtable: beyond billion requests per second on a commodity serverAntonios Katsarakis
This slide deck presents DLHT, a concurrent in-memory hashtable. Despite efforts to optimize hashtables, that go as far as sacrificing core functionality, state-of-the-art designs still incur multiple memory accesses per request and block request processing in three cases. First, most hashtables block while waiting for data to be retrieved from memory. Second, open-addressing designs, which represent the current state-of-the-art, either cannot free index slots on deletes or must block all requests to do so. Third, index resizes block every request until all objects are copied to the new index. Defying folklore wisdom, DLHT forgoes open-addressing and adopts a fully-featured and memory-aware closed-addressing design based on bounded cache-line-chaining. This design offers lock-free index operations and deletes that free slots instantly, (2) completes most requests with a single memory access, (3) utilizes software prefetching to hide memory latencies, and (4) employs a novel non-blocking and parallel resizing. In a commodity server and a memory-resident workload, DLHT surpasses 1.6B requests per second and provides 3.5x (12x) the throughput of the state-of-the-art closed-addressing (open-addressing) resizable hashtable on Gets (Deletes).
What is an RPA CoE? Session 1 – CoE VisionDianaGray10
In the first session, we will review the organization's vision and how this has an impact on the COE Structure.
Topics covered:
• The role of a steering committee
• How do the organization’s priorities determine CoE Structure?
Speaker:
Chris Bolin, Senior Intelligent Automation Architect Anika Systems
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.
Taking AI to the Next Level in Manufacturing.pdfssuserfac0301
Read Taking AI to the Next Level in Manufacturing to gain insights on AI adoption in the manufacturing industry, such as:
1. How quickly AI is being implemented in manufacturing.
2. Which barriers stand in the way of AI adoption.
3. How data quality and governance form the backbone of AI.
4. Organizational processes and structures that may inhibit effective AI adoption.
6. Ideas and approaches to help build your organization's AI strategy.
Your One-Stop Shop for Python Success: Top 10 US Python Development Providersakankshawande
Simplify your search for a reliable Python development partner! This list presents the top 10 trusted US providers offering comprehensive Python development services, ensuring your project's success from conception to completion.
TrustArc Webinar - 2024 Global Privacy SurveyTrustArc
How does your privacy program stack up against your peers? What challenges are privacy teams tackling and prioritizing in 2024?
In the fifth annual Global Privacy Benchmarks Survey, we asked over 1,800 global privacy professionals and business executives to share their perspectives on the current state of privacy inside and outside of their organizations. This year’s report focused on emerging areas of importance for privacy and compliance professionals, including considerations and implications of Artificial Intelligence (AI) technologies, building brand trust, and different approaches for achieving higher privacy competence scores.
See how organizational priorities and strategic approaches to data security and privacy are evolving around the globe.
This webinar will review:
- The top 10 privacy insights from the fifth annual Global Privacy Benchmarks Survey
- The top challenges for privacy leaders, practitioners, and organizations in 2024
- Key themes to consider in developing and maintaining your privacy program
For the full video of this presentation, please visit: https://www.edge-ai-vision.com/2024/06/temporal-event-neural-networks-a-more-efficient-alternative-to-the-transformer-a-presentation-from-brainchip/
Chris Jones, Director of Product Management at BrainChip , presents the “Temporal Event Neural Networks: A More Efficient Alternative to the Transformer” tutorial at the May 2024 Embedded Vision Summit.
The expansion of AI services necessitates enhanced computational capabilities on edge devices. Temporal Event Neural Networks (TENNs), developed by BrainChip, represent a novel and highly efficient state-space network. TENNs demonstrate exceptional proficiency in handling multi-dimensional streaming data, facilitating advancements in object detection, action recognition, speech enhancement and language model/sequence generation. Through the utilization of polynomial-based continuous convolutions, TENNs streamline models, expedite training processes and significantly diminish memory requirements, achieving notable reductions of up to 50x in parameters and 5,000x in energy consumption compared to prevailing methodologies like transformers.
Integration with BrainChip’s Akida neuromorphic hardware IP further enhances TENNs’ capabilities, enabling the realization of highly capable, portable and passively cooled edge devices. This presentation delves into the technical innovations underlying TENNs, presents real-world benchmarks, and elucidates how this cutting-edge approach is positioned to revolutionize edge AI across diverse applications.
zkStudyClub - LatticeFold: A Lattice-based Folding Scheme and its Application...Alex Pruden
Folding is a recent technique for building efficient recursive SNARKs. Several elegant folding protocols have been proposed, such as Nova, Supernova, Hypernova, Protostar, and others. However, all of them rely on an additively homomorphic commitment scheme based on discrete log, and are therefore not post-quantum secure. In this work we present LatticeFold, the first lattice-based folding protocol based on the Module SIS problem. This folding protocol naturally leads to an efficient recursive lattice-based SNARK and an efficient PCD scheme. LatticeFold supports folding low-degree relations, such as R1CS, as well as high-degree relations, such as CCS. The key challenge is to construct a secure folding protocol that works with the Ajtai commitment scheme. The difficulty, is ensuring that extracted witnesses are low norm through many rounds of folding. We present a novel technique using the sumcheck protocol to ensure that extracted witnesses are always low norm no matter how many rounds of folding are used. Our evaluation of the final proof system suggests that it is as performant as Hypernova, while providing post-quantum security.
Paper Link: https://eprint.iacr.org/2024/257
How information systems are built or acquired puts information, which is what they should be about, in a secondary place. Our language adapted accordingly, and we no longer talk about information systems but applications. Applications evolved in a way to break data into diverse fragments, tightly coupled with applications and expensive to integrate. The result is technical debt, which is re-paid by taking even bigger "loans", resulting in an ever-increasing technical debt. Software engineering and procurement practices work in sync with market forces to maintain this trend. This talk demonstrates how natural this situation is. The question is: can something be done to reverse the trend?
Have you ever been confused by the myriad of choices offered by AWS for hosting a website or an API?
Lambda, Elastic Beanstalk, Lightsail, Amplify, S3 (and more!) can each host websites + APIs. But which one should we choose?
Which one is cheapest? Which one is fastest? Which one will scale to meet our needs?
Join me in this session as we dive into each AWS hosting service to determine which one is best for your scenario and explain why!
"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.
Generating privacy-protected synthetic data using Secludy and MilvusZilliz
During this demo, the founders of Secludy will demonstrate how their system utilizes Milvus to store and manipulate embeddings for generating privacy-protected synthetic data. Their approach not only maintains the confidentiality of the original data but also enhances the utility and scalability of LLMs under privacy constraints. Attendees, including machine learning engineers, data scientists, and data managers, will witness first-hand how Secludy's integration with Milvus empowers organizations to harness the power of LLMs securely and efficiently.
Generating privacy-protected synthetic data using Secludy and Milvus
PHP Benelux 2012: Magic behind the numbers. Software metrics in practice
1. Magic behind the
numbers
Software metrics in
practice
Sebastian Marek, Software Architect
2. @proofek
• a Pole living in Sheffield
• over 10 years PHP
experience
• co-author of 2 PHP books
• big fan of process
automation
• TDD and CI
• occasionally contributes
to open source projects
• wants to be a knight
3. Agenda
What I will be talking about
• Code metrics
• Design metrics
What I will not be talking about
• Project metrics
https://joind.in/4758
6. What is a metric?
“It is the mapping of a particular
characteristic of a measured entity to
a numerical value”
Source: Object-Oriented Metrics in Practice
7. Software design
“Good design quality metrics are not
necessarily indicative of good designs.
Likewise, bad design quality metrics
are not necessarily indicative of bad
designs”
Source: Jdepend Docs
8. System maintenance
• Obsolete documentation
• Convoluted design
• Intensive patch mechanism (hacking)
• Large size
• Severe duplication
• Obsolete parts (dead code)
• Long build times
• Loss of original developers
9. Simple metrics
• CLOC – comment lines of code
• ELOC – executable lines of code
• LOC – lines of code
• NCLOC – non comment lines of code
• NOP – number of packages
• NOC – number of classes
• NOM – number of methods
10. Cyclomatic Complexity (CYCLO)
Cyclomatic complexity measures the
amount of decision logic in a single software
module.
24. JAVA
Metric Low Avg High V.High
CYCLO/Line of code 0.16 0.20 0.24 0.36
LOC/Method 7 10 13 19.5
NOM/Class 4 7 10 15
Source: Object-Oriented Metrics in Practice (based on 45 Java projects)
25. C++
Metric Low Avg High V.High
CYCLO/Line of code 0.20 0.25 0.30 0.45
LOC/Method 5 10 16 24
NOM/Class 4 9 15 22.5
Source: Object-Oriented Metrics in Practice (based on 37 C++ projects)
26. WMC and AMW
Weighted Method Count – total complexity of a class
Average Method Weight – average complexity of a method
27. JAVA
Metric Low Avg High V.High
WMC 5 14 31 47
AMW 1.1 2.0 3.1 4.7
LOC/Class 28 70 130 195
Source: Object-Oriented Metrics in Practice (based on 45 Java projects)
28. C++
Metric Low Avg High V.High
WMC 4 23 72 108
AMW 1.0 2.5 4.8 7.0
LOC/Class 20 90 240 360
Source: Object-Oriented Metrics in Practice (based on 37 C++ projects)
35. NPATH – acyclic execution path complexity
NPATH is an objective measure of software
complexity related to the ease with which
software can be comprehensively tested
Edgar H. Sibley
36. NPATH – acyclic execution path complexity
expressions Number of && and || operators in expression
if NP(<if-range>)+NP(<expr>)+1
if-else NP(<if-range>)+NP(<else-range>)+NP(<expr>)
while NP(<while-range>)+NP(<expr>)+1
for NP(<for-range>)+NP(<expr1>)+NP(<expr2>)+
NP(<expr3>)+1
break 1
continue 1
return 1
sequential 1
function call 1
37. NPATH – example
class Foo {
public function example() {
if ($a == $b) {
if ($a1 == $b1) {
fiddle();
} else {
fiddle();
}
}
if ($e == $f && $g == $z) {
for ($n = 0; $n < $h; $n++) {
fiddle();
}
}
return true;
}
}
38. NPATH – example
class Foo {
public function example() {
if ($a == $b) {
if ($a1 == $b1) {
fiddle(); 1
} else {
fiddle();
}
}
if ($e == $f && $g == $z) {
for ($n = 0; $n < $h; $n++) {
fiddle();
}
}
return true;
}
}
39. NPATH – example
class Foo {
public function example() {
if ($a == $b) {
if ($a1 == $b1) {
fiddle(); 1
} else {
fiddle(); 2
}
}
if ($e == $f && $g == $z) {
for ($n = 0; $n < $h; $n++) {
fiddle();
}
}
return true;
}
}
40. NPATH – example
class Foo {
public function example() {
if ($a == $b) {
if ($a1 == $b1) { 2
fiddle(); 1
} else {
fiddle(); 2
}
}
if ($e == $f && $g == $z) {
for ($n = 0; $n < $h; $n++) {
fiddle();
}
}
return true;
}
}
41. NPATH – example
class Foo {
public function example() {
if ($a == $b) {
if ($a1 == $b1) {
fiddle();
} else { 2
fiddle();
}
}
if ($e == $f && $g == $z) {
for ($n = 0; $n < $h; $n++) {
fiddle();
}
}
return true;
}
}
42. NPATH – example
class Foo {
public function example() {
if ($a == $b) {
if ($a1 == $b1) {
fiddle();
} else { 2
fiddle();
}
}
if ($e == $f && $g == $z) {
for ($n = 0; $n < $h; $n++) {
fiddle();
}
}
return true;
}
}
43. NPATH – example
class Foo {
public function example() {
if ($a == $b) { 2
if ($a1 == $b1) {
fiddle();
} else { 2
fiddle();
}
}
if ($e == $f && $g == $z) {
for ($n = 0; $n < $h; $n++) {
fiddle();
}
}
return true;
}
}
44. NPATH – example
class Foo {
public function example() {
if ($a == $b) { 2
if ($a1 == $b1) {
fiddle();
} else { 2
fiddle();
}
} 3
if ($e == $f && $g == $z) {
for ($n = 0; $n < $h; $n++) {
fiddle();
}
}
return true;
}
}
45. NPATH – example
class Foo {
public function example() {
if ($a == $b) {
if ($a1 == $b1) {
fiddle();
} else { 3
fiddle();
}
}
if ($e == $f && $g == $z) {
for ($n = 0; $n < $h; $n++) {
fiddle();
}
}
return true;
}
}
46. NPATH – example
class Foo {
public function example() {
if ($a == $b) {
if ($a1 == $b1) {
fiddle();
} else { 3
fiddle();
}
}
if ($e == $f && $g == $z) {
for ($n = 0; $n < $h; $n++) {
fiddle(); 1
}
}
return true;
}
}
47. NPATH – example
class Foo {
public function example() {
if ($a == $b) {
if ($a1 == $b1) {
fiddle();
} else { 3
fiddle();
}
}
if ($e == $f && $g == $z) {
for ($n = 0; $n < $h; $n++) { 1
fiddle(); 1
}
}
return true;
}
}
48. NPATH – example
class Foo {
public function example() {
if ($a == $b) {
if ($a1 == $b1) {
fiddle();
} else { 3
fiddle();
}
}
if ($e == $f && $g == $z) {
for ($n = 0; $n < $h; $n++) { 1
fiddle(); 1
} 2
}
return true;
}
}
49. NPATH – example
class Foo {
public function example() {
if ($a == $b) {
if ($a1 == $b1) {
fiddle();
} else { 3
fiddle();
}
}
if ($e == $f && $g == $z) {
for ($n = 0; $n < $h; $n++) {
fiddle(); 2
}
}
return true;
}
}
50. NPATH – example
class Foo {
public function example() {
if ($a == $b) {
if ($a1 == $b1) {
fiddle();
} else { 3
fiddle();
}
}
if ($e == $f && $g == $z) {
for ($n = 0; $n < $h; $n++) {
fiddle(); 2
}
}
return true;
}
}
51. NPATH – example
class Foo {
public function example() {
if ($a == $b) {
if ($a1 == $b1) {
fiddle();
} else { 3
fiddle();
}
}
if ($e == $f && $g == $z) { 3
for ($n = 0; $n < $h; $n++) {
fiddle(); 2
}
}
return true;
}
}
52. NPATH – example
class Foo {
public function example() {
if ($a == $b) {
if ($a1 == $b1) {
fiddle();
} else { 3
fiddle();
}
}
if ($e == $f && $g == $z) { 3
for ($n = 0; $n < $h; $n++) {
fiddle(); 2
}
} 4
return true;
}
}
53. NPATH – example
class Foo {
public function example() {
if ($a == $b) {
if ($a1 == $b1) {
fiddle();
} else { 3
fiddle();
}
}
if ($e == $f && $g == $z) {
for ($n = 0; $n < $h; $n++) {
fiddle(); 4
}
}
return true;
}
}
54. NPATH – example
class Foo {
public function example() {
if ($a == $b) {
if ($a1 == $b1) {
fiddle();
} else { 3
fiddle();
}
}
if ($e == $f && $g == $z) {
for ($n = 0; $n < $h; $n++) {
fiddle(); 4
}
}
return true; 1
}
}
55. NPATH – example
class Foo {
public function example() {
if ($a == $b) {
if ($a1 == $b1) {
fiddle();
} else {
fiddle();
}
}
12
if ($e == $f && $g == $z) {
for ($n = 0; $n < $h; $n++) {
fiddle();
}
}
return true;
}
}
71. Summary
“We believe that software metrics, in general, are just tools. No
single metric can tell the whole story; it’s just one more data
point. “
“Metrics are meant to be used by developers, not the other way
around – the metric should work for you, you should not have
to work for the metric. “
“Metrics should never be an end unto themselves. Metrics are
meant to help you think, not to do the thinking for you.”
Alberto Savoia
72. Resources
• PHP Depend - http://pdepend.org/
• PHP Mess Detector - http://phpmd.org/
• Manuel’s home page - http://manuel-pichler.de/
• PHPUnit - http://www.phpunit.de/
• phploc - http://sebastianbergmann.github.com/phploc/
• Sonar - http://www.sonarsource.org/
• “Object-Oriented Metrics in Practice” by Michele Lanza
and Radu Marinescu (ISBN 978-3540244295)