Issue 39 - September 2015 - Today Software Magazine

Page 1

39 • June September • www.todaysoftmag.ro • www.todaysoftmag.com No. 36 2015 • 2015 www.todaysoftmag.ro • www.todaysoftmag.com

TSM

T O D A Y S O F T WA R E MAG A Z I NE

Download from

Windows Store

Agile Humanum Est

Cluj IT Days 2015

BDD by Cucumber Low latency FIX engine in Java jOOQ, for the simplification of SQL integration into Java API Design - A Case Study Become a better tester with BBST

SmartWeb conference 2015 Online Marketing Specialist Vs. Marketing Agency – Which is best for you OSM and Telenav: through the eyes of a Map Analyst How to increase our level of happiness


Innovation, entrepreneurship and technologies Venue: Cluj Arena, conference hall, 24-25 November 2015, Cluj-Napoca www.itdays.ro - 2 days access, 80 euro + TVA

Peter Lawrey

Robert Mureșan

Christoph Steindl

Diana Tîrnovan

Vlad Derdeicea

Cristian Philipp

Simona Bonghez

CEO at Higher Frequency Trading

CEO Exosyphen

Accesa

Rareș Florea

Conf. Dr. Mihai Oltean

Tudor Mărghidanu

Vasile Mihali

Andreea Pârvu

Dan Suciu, PhD

Vasile Pop

Radu Vunvulea

Mircea Vădan

Sergiu Damian

Intel România

Colors in Projects

Arobs

iQuest

November 24

10:00 10:40

11:00 11:30 12:00 12:30 13:00

09:00 09:30

Local Product Launches

10:40 11:10

Coffee & Networking Break Beyond reality. Virtual Reality. The future of gaming and information visualization Robert Mureșan (CEO Exosyphen) The Power of Play Simona Bonghez (CEO Colors in projects) Launch of programez.ro Ovidiu Mățan (TSM) and Vlad Derdeicea (subsign) Lunch Break

15:00

14:00 14:30 15:00

15:30

jOOQ - an object oriented abstraction 15:30 interracting with relational databases Silviu Dumitrescu (Telenav)

16:00

Pizza break

16:00

Big Data 16:20 16:50 17:00

10:10

Software consultant

Let’s “GamEventify”! Adina Grigoriu (Color in projects) (Higher Frequency Trading) Dan Suciu (3Pillar Global) Building a Strong Employer Brand through Organizational Culture Cristian Philipp (Essential Training and Consulting) Usable Software Design A Management Perspective Alexandru Bolboacă (Mozaic Works) Pizza break

16:20

Software Architecture 09:00 09:30

Coffee & Registration Sergiu Damian (iQuarc)

10:10

What is Reactive Programming and why you should care Robert Cristian (3Pillar Global) Decisions in Architecture Florin Cardasim (Endava) Coffee & Networking Break

10:40 11:10

.NET

Seedfortech Mircea Vădan (Fortech)

11:30

12:00 12:30

Coming soon Local startup pitches

12:00 12:30

How to manage one million messages per second using Azure Radu Vunvulea (iQuest) Coming soon Coming soon

13:00

Lunch Break

13:00

Lunch Break

Research 14:00

Hands on Lab 14:00

Low Latency in Java 8 Peter Lawrey (Higher Frequency Trading)

14:30

Using artificial intelligence for automatizing software development Răzvan Florian (Romanian Institute of Science and Technology) Coming soon

15:00

Coming soon

15:00

15:30 16:00

Coming soon Pizza break

15:30 16:00

Creating things with a 3D printer Mihai Oltean (Babeș-Bolyai University) Coming soon Pizza break

HR & Management

16:50

Selenium WebDriver patterns for maintanability Vasile Pop (Intel) Coming soon

16:20 16:50

17:00 17:50

Coming soon Networking & wine

17:20 17:50

Partners

Coffee & Registration Driving innovation –TechLeague Diana Tîrnovan (Accesa) și Florin Pascaru (Accesa) Growth Hacking and Lean Canvas Christoph Steindl (CEO Catalyst Software) Șerban Țîr (CTO Gemini Solutions) Coffee & Networking Break

11:30

Automated testing

Tudor Mărghidanu (Yardi) Data modeling in Apache Hadoop Tudor Lăpușanu (Telenav) Machine Learning in the age of Big Data Daniel Sârbe (SDL)

clujstartups.com

Startups & Entrepreneurship

Management

Work with Hundreds of Hot Terabytes in JVMs Peter Lawrey (Higher Frequency Trading) Be Fast, be Off-JVM, be Chronicle-Queue Vasile Mihali (AROBS)

3Pillar Global

Endava

Startups & Entrepreneurship

Coffee & Registration Opening Remarks Cluj IT Cluster & Ovidiu Mățan (Organizer of IT Days) Vector Watch in the Context of Wearable Fashion Trends Rareș Florea (Vector Watch) Innovation in Product Development and Future of Work Christoph Steindl (CEO Catalysts Software)

Java 14:00

Babeș Bolyai University

November 25

Trends & Leadership Sessions 09:00 09:30

Vector Watch

CTO Gemini Foundry

Yardi România

Subsign

Essential Training and Consulting

Șerban Țîr

CEO Catalysts

Andreea Pârvu (Endava) It is easy to integrate young people in IT companies? Dan Ionescu (Danis) Coming soon Networking & wine

Hands on Lab 16:20

Coming soon

16:50 17:00 17:50

Coming soon Coming soon Networking & wine

Organiser


6 Cluj IT Days 2015 Ovidiu Măţan

8 SmartWeb conference 2015 Alexandru Botez

9 Let’s talk about Cluj-Napoca’s next 35 years Stelian Burduhos

12 Agile Humanum Est Dan Suciu

15 API Design A Case Study Andrada Demian

18 Low latency FIX engine in Java Peter Lawrey

20 jOOQ, for the simplification of SQL integration into Java Silviu Dumitrescu and Diana Bălan

22 OSM and Telenav: through the eyes of a Map Analyst Florin Badita, Mihai Iepure and Gabriela Sinka

24 BDD by Cucumber Indrie Sergiu

28 Become a better tester with BBST Monica Rațiu

30 Code for a space full of joy Alexandra Banu

32 Online Marketing Specialist Vs. Marketing Agency – Which is best for you Călin Biriș

34 How to increase our level of happiness Cristina Vâjâean

36 2016 PFA Taxation Ioana Varga


editorial

S

Ovidiu Măţan

ovidiu.matan@todaysoftmag.com Editor-in-chief Today Software Magazine

chool has started for two weeks! Recently, the university year began, too! And at the same time with them, inevitably, the mass-media resounds with the same choir of lamentations related to the precarious state of the Romanian system of education. We hope this choir does not resemble those of the antique Greek tragedies and sing about the destiny of a perpetual doom of education into degradation and derisory. In order to prove the importance of education in the progress of society it is enough to take a look towards the IT domain. Without the prestigious universities, the IT industry couldn’t have reached the level it is on today in the big cities of Romania. Actually, any IT company and not only, which wishes to open an office in a city, will be interested in the level of education or the universities existing in the respective community. If we relate to a reference ecosystem, such as Silicon Valley, made up of companies/ startups, investors and universities, we notice that the latest are a compulsory ingredient in creating a competitive industry. If the financing of startups and finding investors has begun to be a natural thing, consciously and responsibly assumed, the financing of universities does not depend only on the local ecosystem, but also on the social and political context. Let us only mention those cases when entire departments were closed because the professor went to work for a private company, or when the students are expected to learn from old and outdated textbooks. What are the solutions? We hope it does not remain a rhetorical question and we will be able to find a consistent answer if we want the growth of the IT sector. One first solution to this problem may be the organization on the 24th-25th of November of the third edition of Cluj IT Days by Today Software Magazine, which is meant to be a good opportunity of learning and soldering of the IT community in Cluj. You can find more details in the article dedicated to this subject. Concerning the content of this issue, we signal the article of Dan Suciu, Agile Humanum Est, with an interesting title that paraphrases a famous Latin saying – Errare humanum est… We go on with the API Design – a Case Study, which debates the rules of defining an API and illustrates it with the one used within Betfair. Performance in Java is discussed in Low latency FIX engine in Java, an engine created by Peter Lawrey, also invited to Cluj IT Days. Unfortunately, the article was too technical for a useful translation into Romanian and we have decided to keep it in English in order not to miss its scientific precision. Still in the Java area, jOOQ for the simplification of SQL integration in Java, proposes an abstraction built on the relational and object oriented models (ORM) of the data bases. OpenStreetMap is a crowd-sourced project used by Telenav as a base in the products offered, but you can find more details in the article called OSM and Telenav seen through the eyes of a map analyst. Next, we present a testing tool: Cucumber, which is based on the concept of Behaviour Driven Design. In the end, we recommend the article on what a registered sole trader (PFA) means in 2016.

Ovidiu Măţan

Founder of Today Software Magazine

4

no. 39/2015, www.todaysoftmag.com


Editorial Staf Editor-in-chief: Ovidiu Mățan ovidiu.matan@todaysoftmag.com Graphic designer: Dan Hădărău dan.hadarau@todaysoftmag.com Copyright/Proofreader: Emilia Toma emilia.toma@todaysoftmag.com Translator: Roxana Elena roxana.elena@todaysoftmag.com Reviewer: Tavi Bolog tavi.bolog@todaysoftmag.com Accountant : Delia Mircea delia.mircea@todaysoftmag.com Junior developer: Alexandru Diniș alexandru.dinis@todaysoftmag.com Marketing specialist and tehnoredactor: Ana-Maria Bivol anamaria.bivol@todaysoftmag.com Printed by Daisler Print House

Authors list Ovidiu Măţan ovidiu.matan@todaysoftmag.com

Florin Badita florin.badita@telenav.com

Editor-in-chief Today Software Magazine

Software developer @ Telenav

Alexandru Botez alexandru.botez@geminisols.ro

Mihai Iepure mihai.iepure@telenav.com

Web Developer @ Gemini Solutions

Software developer @ Telenav

Stelian Burduhos stelian.burduhos@gmail.com

Gabriela Sinka gabriela.sinka@telenav.com

Director @ Danube Conference Member @ JCI Cluj

Map analyst @ Telenav

Dan Suciu dan.suciu@3pillarglobal.com

Sergiu Indrie sergiu.indrie@iquestgroup.com

Director of Delivery @ 3Pillar Global

Senior Software Engineer @ iQuest Group

Andrada Demian andrada.demian@betfair.com

Monica Rațiu monica.ratiu@altom.ro

Developer @ Betfair

Marketing Specialist @ Altom

Peter Lawrey peter.lawrey@ highfrequencytrading.com

Alexandra Banu alexandra.banu@cos.ro

Made by

Today Software Solutions SRL str. Plopilor, nr. 75/77 Cluj-Napoca, Cluj, Romania contact@todaysoftmag.com www.todaysoftmag.com www.facebook.com/todaysoftmag twitter.com/todaysoftmag

ISSN 2285 – 3502 ISSN-L 2284 – 8207

Copyright Today Software Magazine Any reproduction or total or partial reproduction of these trademarks or logos, alone or integrated with other elements without the express permission of the publisher is prohibited and engage the responsibility of the user as defined by Intellectual Property Code www.todaysoftmag.ro www.todaysoftmag.com

CEO @ Higher Frequency Trading Ltd

Marketing & PR Responsible @ COS

Silviu Dumitrescu silviu.dumitrescu@accesa.eu

Călin Biriș calin.biris@loopaa.ro

Engineer manager @Telenav

Digital Director @ Loopaa

Diana Bălan diana.balan@accesa.eu Java developer @ Telenav

Cristina Vâjâean cristina.vajaean@happy-employees.eu Research Specialist @ Azimut Happy Employees

Ioana Varga ioana.varga@aiconsulting.ro Bookkeeper & Managing Partner @ A&I Consulting

www.todaysoftmag.com | no. 39/september, 2015

5


event

Cluj IT Days 2015

C

luj IT Days, which this year has reached its third edition, reunites the Transylvanian IT community around the same passion: the development of software and hardware products. If in 2014, the reference topic within the leadership section was the transition from outsourcing to product, this year our topic is the release of Romanian products. Therefore, it is not by chance that the event is going to start by a series of presentations subordinated to this theme. We hope to raise your interest by listing the essential aspects of these presentations: • Vector Watch – one of the most ambitious Romanian products, the Romanian smartwatch, a novel arrival on the Romanian market. • A first demo developed on HTC Vice by the Exosyphen game studio. Provided that we receive the approval of HTC, we shall have a stand where users will be able to test the virtual reality. • The first Romanian management game: PM Galaxy, developed by Colors in Projects. An introduction of the concept of game in project management. • The launching of programez.ro – the latest initiative of Today Software Magazine, conceived as a challenge addressed to all programmers. Vlad Derdeicea from Subsign is our guest who will talk about how the entire concept was created visually. • Christoph Steindl, CEO Catalysts Software, will talk about how to turn the creative potential to profit within a company and about the importance of the way people work. The break will be followed by two sections having technical, management or start-up topics, which will unfold simultaneously, giving thus the participants the chance to choose between the different subjects. In the following lines, we shall present some basic information related to these sections.

Java We begin this section with the presentation of Peter Lawrey, our special guest for this edition, too. He is the Stack Overflow chart with over 11,000 answers,

6

and this year he has been nominated Java Champion by Oracle (https://blogs. oracle.com/java/entry/new_java_champion_peter_lawrey). He has published over 250 articles on his blog, Vanilla Java (http:// vanillajava.blogspot.ro), where he has had more than three million views until now. His company, Chronicle Software (http:// chronicle.software), develops high performance solutions for the banking domain, the developed libraries being available on GitHub (https://github.com/OpenHFT). His first presentation in Cluj IT Days, Work with Hundreds of Hot Terabytes in JVMs, will also be presented this year in Java One, in San Francisco. For those who are interested in Java performance, Peter will lead a separate workshop, on which you can find more details in the workshops chapter. We go on with the presentation delivered by Vasile Mihali: Be Fast, Be O¬-JVM, Be Chronicle-Queue, which presents a practical usage of the libraries developed by Peter Lawrey. In the end of this section, Silviu Dumitrescu, an old collaborator of our magazine, will talk about JOOQ – an object modeling of interaction with relational data bases.

Management

dedicated to it within Cluj IT Days. The next presentation will be delivered by Dan Suciu, whom you know from the previous Cluj IT Days editions and also from the articles published in Today Software Magazine. His passion for programming and Agile methodologies is well-known, and his presentation will certainly prove it once more. Cristian Philipp will come from Timisoara to talk about what it means to build a powerful company brand by using the organizational culture. At the end of this section, Alexandru Boloboaca will share with us some of his experience with software craftsmanship.

Big Data A fashionable topic nowadays. We had to have a section centered on this subject. Just like last year, Tudor Marghidanu will deliver a presentation from the perspective of a software architect. Tudor Lapusanu is next, with data modelling in Apache Hadoop, and finally, Daniel Sarbe will talk about machine learning and the connection with big data.

Testing We will analyze Selenium Webdriver from Vasile Pop’s (Vic’s) perspective. The remaining slots are still open; any proposal will be taken into consideration. We conclude, thus, the first day of the event, with a session of socialization and a glass of wine.

In this domain, you will have the opportunity to meet people who have been close to and have supported TSM magazine along time. Adina Grogoriu, the colleague of Simona Bonghez, whom you probably know from the PMP trainings, will talk about “GamEventify!”, the adding Start-ups and entrepreneurship of the gamification concept in conferenThe Romanian startup area will preces and events. This is a concept you will sent two programs that are different be able to explore within the workshop in approach, but which support local

no. 39/september, 2015 | www.todaysoftmag.com


programare initiatives, namely Seedfortech and TechLeague. Moreover, Serban Tir from CTO Gemini will talk to us about startups and acceleration programs based on his daily experience in this domain. Christoph Steindl, CEO Catalyst, will approach Growth Hacking and Lean Canvas from a practical perspective. At the end of this section, we will have a startup pitch session, during which we will try to bring the most interesting local startups on stage.

Research Through this section we are trying to bring the latest achievements of this domain to focus and at the same time to bring the academic world and the local IT environment together. Razvan Florian will present a research carried out on the possibility of generation of automatic software. It is a novel approach and Florian hopes not to offend the programmers attending. Another presentation will be on autonomous driving.

Hands On Lab After last year’s success with the presentation of the 3D printer built by Professor Mihai Oltean, we have decided to make a Hands On Lab section, so that the presentations be closer to the audience. You will be able to better understand the stages and the examples of code written for the printing of a 3D object. Peter Lawrey will be present again, closer to the audience, with his presentation called Low Latency in Java 8, from which we will learn how to use the facilities of Java 8 language in order to write low latency applications more easily or how we

TODAY SOFTWARE MAGAZINE can tune the garbage collector when using Lambda constructions. Still in this section, we will be able to learn how to program an industrial robot. More details will soon be added to the program.

Motivation for participating IT Days is meant to be a festive celebration of the activity of the entire year, together with the whole IT community from Cluj, given the fact that Today Software Magazine organizes monthly events. If you want to be up to date with the latest software trends of the local community in the sections above, then the event will surely respond to your needs. Just like in the last years, there will be a friendly atmosphere and high professional level presentations. During the breaks, you will have the opportunity to see, in the displayed stands, innovative products and initiatives of the local companies. Most of the participants will be programmers, followed by managers and testers. Actually, the share of the domain chosen for presentations follows this trend.

Engine hands-on. The second workshop, Let’s have fun and learn – Project Management by using PM Galaxy Boardgame, represents an introduction to project management. The game will lead the participants through all the stages of development of a project: initialization, planning, execution, monitoring and control, completion. The participants will have to deal with traps, challenges and they will experience best practices with the help of the game especially developed for this workshop: PM Galaxy. The workshop will be hosted by Simona Bonghez. You can find more details on www.itdays.ro.

Conclusion I hope I have persuaded you to join us and take part, this year, too, in Cluj IT Days. To our faithful readers, we offer a 15% discount of the price of the ticket displayed on the site, on using the promotional code: TSM_ITDAYS_2015, available till October 15th.

Workshops Java Performance Just like in the previous years, one day before the conference, on November 23rd, we shall organize two workshops. One of them is the Java Performance workshop, led by Peter Lawrey, where the people attending will have the chance to discover: an advanced review on the manner in which JVM uses memory, the usage of Lambda structures from Java 8 to the limit and beyond that, the usage of Chronicle

Ovidiu Măţan

ovidiu.matan@todaysoftmag.com Editor-in-chief @ Today Software Magazine Organizer @ Cluj IT Days

www.todaysoftmag.com | no. 39/september, 2015

7


event

SMARTWEB CONFERENCE 2015

T

he third edition of SmartWeb Conference took place on September 21st and 22nd at JW Marriot Bucharest Grand Hotel. It is the most important East-European event dedicated to web developers and designers. After the success of the first two editions, Evensys had proposed organizing this year eight international level conferences, for the participants to discover the latest tendencies in web and mobile development and meet colleagues and great people from the web industry. Among the great names the participants had the opportunity to listen to and meet, we can mention: Bruce Lawson (Opera), Petro Salema (Gentics), Roy Tomeij (Advanced SASS), Stephen Hay (Zero Interface), Tobias Ahlin (Lookback, in the past Github and Spotify), Soldedad Penades (Mozilla), Heydon Pickering (Neontribe), Andy Hume (Twitter) and Christian Heilmann (Microsoft). During the first day, the participants were able to take part in an advanced workshop on Sass CSS, together with Roy Tomeij, and the second day was dedicated to the eight conferences. CSS, Responsive Web Design, HTML5 & CSS3 and Java represented the main domains tackled in the conferences. The second day was started by Petro Salema, who raised some questions regarding the amount of information we offer to the web and the way in which this information is analyzed and used. Other subjects he tackled were UX design and the how the web applications development has progressed from desktop first to mobile first, to predicative backend first at the present moment.

He was followed by Roy Tomeij, who proved live how simple it is to achieve advanced things by using Sass CSS. The idea of simplicity was carried on also in the following conference, that of Stephen Hay, who believes that we often spoil things in the development stage due to unnecessary complexity and he presented the main reasons why and how we complicate them. Tobias Ahlin contributed by a presentation on the CSS animations, where he gave us some pieces of advice and ideas on their usage and performance. The second part of the day was started by Soledad Penades, with a presentation on Web Audio API, focused on the way it can significantly increase the performance of the application and how it gives us the possibility to build sophisticated and efficient tools with little effort. Heydon Pickering also exposed some interesting ideas in his conference on prototyping the design on paper. He thinks it is essential for web design to start on paper, offering thus the entire team (whether designer or developer) the opportunity to express their opinion.

Right before the last conference of the day, Andy Hume spoke about the importance of the loading speed of a website and how much it affects the user experience. Andy also presented the main causes for this problem, as well as manners in which they can be avoided. The day was ended by Christian Heilmann, who had probably the most captivating presentation of the day. He talked about how we make our lives more difficult by asking for new things instead of using what already exists, or by writing awful code and blaming other people or the environment for it. All in all, it was a very successful event, with exceptional and funny speakers. I recommend to everyone who did not take part in it to have a look at least at Christian Heilmann’s conference – “The wheel is spinning, but the hamster is dead”, which can be found online. “People should have an awful experience on the awful browsers, as this way they have the chance to move on to a better browser”, is but one of the funny quotes from this conference, which I will never forget. I shall definitely not miss next edition !

Alexandru Botez

alexandru.botez@geminisols.ro Web Developer @ Gemini Solutions

8

no. 39/september, 2015 | www.todaysoftmag.com


event

Let’s talk about Cluj-Napoca’s next 35 years

T

he development of cities as big as Cluj-Napoca, Bucharest, Constanta or Timisoara is no longer only about road infrastructure, new buildings and bigger shopping malls. The new workers are no longer the employees of the construction sector but the young programmers doing the „9 to 5” in IT companies. With every application that controls the urban transportation and each software that allows online payments they are shaping the future of every town. While cities like Vienna already have a “Smart City Framework Strategy” in Romania the concept is still at the very beginning. Stelian Burduhos stelian.burduhos@gmail.com Director @ Danube Conference Member @ JCI Cluj

This is the main reason why Junior Chamber International (JCI) is dedicating this year’s convention and also its Danube conference to the development of cities. During the four days of the JCI Danube Conference and The Annual National JCI Convention 2015 hosted in Cluj-Napoca between 15 – 18 October the participants will create an international framework - a common base that will serve as a model of good practice for our communities in the next 20 to 50 years.

It all started with an app An app that will change the way we find parking places, another one that lets us pay for the parking services via SMS, a few that make urban transportation much easier and more than one software that controls the street lighting. And this is only the beginning. Cluj-Napoca, the second town in Romania and the heart of Transylvania

is practically turning into a “Smart City” without even knowing it. But the concept behind the “Smart Cities” is much more complicated and from this point forward Cluj-Napoca and frankly every city in Romania and Europe needs a master plan for the future. Michael Haupl, the mayor of Vienna put everything into perspective since 2011 when the city made a “roadmap” for the next 35 years: “A Smart City is a city that meets the challenges posed by dual challenge of reduced energy consumption coupled with growing demands. The required changes in the energy, transportation and building sector, many of which are fundamental to the process, cannot be made overnight”. We have a daring proposal for you: debate with us, young entrepreneurs, companies that innovate in IT and the local authorities already pioneering in this field the importance of the ways cities will develop in years to come. All of the ideas will

www.todaysoftmag.com | no. 39/september, 2015

9


event

Let’s talk about Cluj-Napoca’s next 35 years

be presented and analyzed during the SMART Cities Forum. With the help of some of the 300 IT&C companies based in the city we intend to take the debate further to a more practical approach. The SMART Cities Forum will be supported by the SMART & Innovative Expo. For two days, the representatives of the local communities in Germany, Austria, Hungary, Serbia, Croatia, Romania and Moldavia will have the opportunity of meeting people that build “smart cities” solutions, from apps to full functional environment systems and none the less visit the biggest IT companies in this field from Cluj-Napoca. This approach will generate real solutions for the future and with the help of the national and international speakers, the vision of every participant and the workshops at the end of the four days a common base for the development of the cities of the future will be created. We are proud to announce that the SHARE Federation, the main organizer of the European Youth Capital, title achieved by Cluj-Napoca for 2015 is supporting the from all over the country and it already JCI Danube Conference and The Annual has 300 members and three action groups. National JCI Convention 2015. The dedication and the experience of all its members made JCI Romania an important voice in the east-central Europe in a short The “Mission” behind JCI JCI is a nonprofit organization of young time. and active citizens aged 18 to 40 who are This year we wanted to bring an interengaged and committed to creating a better way of living for their communities. national JCI event to Cluj-Napoca. It’s the In 2015 the organization is celebrating its year of the European Youth Capital and 100 anniversary nation wide and the 12th we invite you along us in this four day journey of the JCI Danube Conference in Romania. All members have the courage to and The Annual National JCI Conference address the critical challenges of our time 2015. We want to develop with your help and to find targeted solutions to local new collaborations between cities so issues. This is why we consider that the real and efficient solutions for the next best way to celebrate 100 years of exis- years are created. Basically we want to tence is to act and build our future. JCI shape the communities of the future – Romania reunites nine local organizations Stelian Burduhos, COC Director Danube

10

no. 39/september, 2015 | www.todaysoftmag.com

Conference Through this double event we want to bring together the local authorities, the community and the young entrepreneurs so a public and open space for innovation is created. This is the reason why we decided to take this unique opportunity and organize the JCI Danube Conference and The Annual National JCI Conference 2015 – Florin Somodi, COC Director National Convention.


TODAY SOFTWARE MAGAZINE

IT communities

W

e are happy that our calendar cannot contain all the nice events. Have fun and try to go to as many as possible, connections and knowleadge are really important !

Transylvania Java User Group Community dedicated to Java technology Website: www.transylvania-jug.org Since: 15.05.2008 / Members: 598 / Events: 47 TSM Community Community built around Today Software Magazine Websites: www.facebook.com/todaysoftmag www.meetup.com/todaysoftmag www.youtube.com/todaysoftmag Since: 06.02.2012 /Members: 2700/ Events: 33 Cluj Business Analysts Comunity dedicated to business analysts Website: www.meetup.com/Business-Analysts-Cluj Since: 10.07.2013 / Members: 91 / Events: 8 Cluj Mobile Developers Community dedicated to mobile developers Website: www.meetup.com/Cluj-Mobile-Developers Since: 05.08.2011 / Members: 264 / Events: 17 The Cluj Napoca Agile Software Meetup Group Community dedicated to Agile methodology Website: www.agileworks.ro Since: 04.10.2010 / Members: 437 / Events: 93 Cluj Semantic WEB Meetup Community dedicated to semantic technology. Website: www.meetup.com/Cluj-Semantic-WEB Since: 08.05.2010 / Members: 192/ Events: 29 Romanian Association for Better Software Community dedicated to experienced developers Website: www.rabs.ro Since: 10.02.2011 / Members: 251/ Events: 14 Tabăra de testare Testers community from IT industry with monthly meetings Website: www.tabaradetestare.ro Since: 15.01.2012/Members: 1243/ Events: 107

Calendar September 29 (Cluj) Lansarea numărului 39 al Today Software Magazine www.todaysoftmag.ro September 30 (Cluj) 5th BigData/DataScience­meetup meetup.com/Big-Data-Data-ScienceMeetup-Cluj-Napoca/events/225393112/ October 1 (Târgu-Mureș) Lansarea numărului 39 al Today Software Magazine www.todaysoftmag.ro October 1 (Cluj) Using Protractor and Appium to automate Hybrid apps meetup.com/Cluj-JS/events/224608770/ October 2 (Cluj) StartUs Connect: Cluj 2.0 facebook.com/events/931928763547194/ October 3 (Cluj) Coach retreat-facilitated­­by Dov Tsal Sela, AgileCoach&FunS­­heriff meetup.com/The-Cluj-Napoca-Agile-Software -Meetup-Group/events/225419940/ October 7-8 (București) Internet & Mobile World www.imworld.ro/ October 7 (Cluj) Fresh start - PHP Cluj meetup.com/PHP-Cluj/events/225555288/ October 14 (Cluj) The Power of Storytelling − Cluj Edition thepowerofstorytelling.org/cluj/ October 15-18 (Cluj) JCI Danube Conference & JCI Romania National Convention 2015 jciromania.ro/danubeconference//

www.todaysoftmag.com | no. 39/september, 2015

11


management

Agile Humanum Est

I

t is strange that today, on a quick search of the word Agile on the internet, you get two categories of answers: a first category contains explanations regarding what Agile is and how it functions and a second category that argues why Agile doesn’t work. There are obviously two points of view: one that offers to introduce you to the Agile

Dan Suciu dan.suciu@3pillarglobal.com Director of Delivery @ 3Pillar Global

12

no. 39/2015, www.todaysoftmag.com

secrets and the other one, less numerous, but which is beginning to be heard louder and louder, which thinks that the Agile practices are harmful and can negatively affect the development of software applications. I personally consider the Agile values and principles as being very natural and fair. I have always thought that a good part of the Agile practices are common sense and that they suit very well the development teams of software projects. Of course, the arguments of this type (natural, fair, common sense) are not meant to satisfy a person accustomed to the demonstrations specific to exact sciences. Therefore, I began to examine more closely the benefits brought by Agile to the development teams. The conclusion I have reached is that the Agile paradigm adapts the processes to the human nature, this being in a contrast to the classical management approach which imposes the members of the team to adjust to a particular development process. In the following lines, I will offer you

a few examples to support my statement, concluding by some pieces of advice regarding what should be done when things don’t work out as we wish in a project.

Human nature and software development There is a series of situations that we have all come across in the projects we have been working on, situations that go beyond the technologies used or the degree of experience. One of these examples is the level of effort that a team makes when they are supposed to carry out something that seems to obey Paretto’s law, also known as the 20/80 rule. More precisely, it seems that the team makes a constant effort during 80% of the time it has at its disposal. Generally, after that period of time runs out, the team realizes all of a sudden that it is not possible to complete their target in the allotted time and the effort level increases considerably (Picture 1). It seems that this pattern repeats itself over and over again in different contexts, for teams of different sizes and configurations, but which have to carry out some creative


TODAY SOFTWARE MAGAZINE activity. The development of a software application is also a creative activity. One of the approaches of this situations is to search for a method for the team to work constantly during the entire period of time available, but it seems, however, that this thing is not in the human nature (see Parkinson’s law - http://www.economist. com/node/14116121).

Picture 1. The distribution of a team’s effort in the process of development

On the other hand, many of the Agile methodologies propose an iterative development, where each of the iterations lasts from 2 to 4 weeks, and at their end, the team has to produce a functional application. Although this approach does not change the rule of effort distribution, towards the end of an iteration, it is much more reduced than in the case when the development period would have been one of three months, for instance, making, thus, the production process smoother, with minimum and maximum levels of effort that are closer to one another.

Picture 2. The distribution of effort using successive iterations

Still in the area of time management, this time on the personal level, it is worth mentioning here another human habit, considered normal up to a certain degree, called procrastination. Procrastination represents a behavior characterized by an unjustified postponing of actions and tasks for later, which is seen as a reaction to the anxiety associated with the beginning or ending of a task or making a decision. This thing can be found precisely in the strategy called “last responsible moment”, especially in the Scrum and Lean methodologies, which implies postponing some irreversible decisions till the moment when the cost of not making them is higher than the cost of adopting them. This strategy is considered benefic since it makes the development process more efficient, as it is not blocked by making some decisions which can be made later on. As it is emphasized in many papers, the “last responsible moment” strategy should not be turned into a justification of procrastination, but rather a way to eliminate it.

Estimating the tasks we have to carry out represents, from my point of view, another example suitable to prove the fact that the Agile paradigm is oriented towards the extraction of the good things out of those behaviors which, in other contexts, would be considered defaults. As I was writing in one of my first articles in Today Software Magazine, “Peculiarities of informatics projects”, the activity of software development is a creative one and there is no schedule to specify the usual period of time necessary for the implementation of certain functionality. One of the things I have noticed while coordinating different teams engaged in the development of software applications is that the motivations and perceptions based on which an estimation is made, differ a lot from one person to another. On the other hand, I have also found out that the accuracy of estimations does not greatly improve with gathering experience. This is due especially to the complexity that is characteristic to software projects. What improvements does Agile bring to estimation? Firstly, it is the collective estimation. Instead of the estimation being made individually, by each person for their own tasks, the entire team takes part in the estimation of all tasks. This substantially reduces the estimation errors and the differences of perception are discussed and cleared out with the entire group. In addition, moving your attention from time estimation to the estimation of the necessary effort by using a particular system of evaluation, leads to an increased estimation speed, without reducing the estimation accuracy. Through these approaches, the experience in the domain is much better turned into advantage and the estimation effort is much reduced. Coming back to the previously mentioned idea, namely that the software development activity is a creative one, I cannot help drawing a parallel between the way in which an application is developed and the way many of the artistic works are done. As you can see in Picture 3, which shows an unfinished painting, the painter did not split the canvas into 6 or 9 distinct areas to be painted successively (characteristic of the plan-driven approach, where the person carrying out an activity is supposed to have in mind, very clearly and detailed, what the result of this activity should look like), but drew a first draft of the entire picture, which he later improved, finally using colours to complete the painting (characteristic of the evolutionary approach, which implies the fact that the final product is completed after a series of successively enhanced versions). You can notice that even at this stage, which is far from being completed, we get an idea of what the painting would look like after being finished and, very importantly, it is still in a stage where substantial improvements can be made with little effort. In all the Agile methodologies, there is support for the evolutionary approach to product creation, the imposed development cycle also has, besides the quality of being interactive, that of being incremental. Thus, the software development activity is sustained on the methodology level, as it is approached in the same manner most of the creative activities are approached. One last example I would like to give is the one related to the fascination we have for complexity. In many situations, we embrace the more complicated solutions to the problems we have, and when we don’t do it, due to the lack of time or other resources, we appreciate them more, anyway, as we are often dissatisfied with the simple solution we have chosen instead. This fascination for complexity is often found also in the software projects development activity: we often prefer the implementation of a www.todaysoftmag.com | no. 39/september, 2015

13


management Agile Humanum Est based on the fact that people’s attention and ability to understand are influenced a lot by the manner in which something is presented. But these things will probably make the topic of a future article. What is more important to understand right now is what we could do …

… when things don’t work.

Picture 3. Paul Gauguin – Tahitians at Rest (1891, unfinished)

framework which can solve much more than the problem we have to solve, without taking into consideration the very high maintenance costs derived from it. And the examples could go on. Here is an interesting experiment. The Bavelas experiment (http://perceptionmanagers.org/2008/08/ bavelas-experiment. html) shows us that when there are several solutions to a problem, the one that is the most complicated and sophisticated usually attracts most appreciations. Aware of this fact, Stefan Roock, consultant, speaker and known author especially for his expertise in Extreme Programming, said at one point that “in software, the complicated solutions are wrong, even though they are right”. Agile introduces the “just enough” concept. From the definition of user stories or the writing of documentation to drawing up the architecture and planning, everything is carried out in the “just enough” approach. This time, Agile no longer lays so well on human nature, but on the contrary: it searches for strategies through which to diminish the negative effects of a common human behavior. The processes are adjusted so as not to give too often the opportunity to the project team to think in a too complicated way. There would be many other examples, from the structure and importance given to the retrospective meetings in Agile (“man learns from his mistakes”) to the idea of user story, which is

14

no. 39/september, 2015 | www.todaysoftmag.com

One of the things Agile couldn’t treat yet is people’s tendency to think into patterns. Thinking into patterns represents an advantage most of the times, because it helps us to observe, analyze and react correctly and faster in many situations. It is the manner in which we have managed to learn many of the things we know today. However, in certain contexts, thinking into patterns may distract our attention from important details. Somebody used to say that in software development the only sure thing is the change. In such a context, trying to apply certain practices and processes which worked out in the past is often dangerous, and most of the times, when things don’t turn out well, we don’t say that the processes or practices are not suitable, but we are rather tempted to put the blame on the people, the context, the lack of resources, etc. Now, to conclude the article, my advice is that, when something doesn’t work in our project and this goes on for a period of time, we should try to analyze and maybe adjust the processes we are using. They might be totally unsuitable to the context and our persistence in changing the context might attract even more problems.


programare

API Design - A Case Study

N

owadays it’s getting harder and harder for a closed product/system to be successful and thus the need to expose an API. API (acronym for Application Programming Interface) clearly defines how the rest of the software world will

Andrada Demian andrada.demian@betfair.com Developer @ Betfair

interact with a software system (or component). An API brings positive advantages like scaling market reach, reduced time to market, flexibility and innovation. Without APIs we could argue that none of the important Web players like Microsoft, Google, Facebook or Twitter (just to name a few) would have been as big as they are today.

Why is API design so hard? Building an API is one of the most important things that can be done to increase the value of a service, however designing a great API is challenging. A well-designed API should reflect the goals of the business it is designed to serve, while at the same time taking into account the organization’s specific strengths and limitations in terms of budget, personal skill sets and technical infrastructure. The key is to know what the API needs to accomplish; unfortunately, this changes over time because the business changes. We all know how lack of flexibility and changing requirements can lead to unmaintainable ‚spaghetti’ code; in the API world, the

same causes lead to methods/operations overloading, legacy versions and deprecation. It follows that the main quality of an API is to support the business and to be flexible enough to survive business changes. Other aspects that should be taken into account when designing or evaluating APIs are: • ease of learning, extension and integration in the client application • likelihood and consequences of misuse • impact over the client code, in terms of maintenance costs • the level at which is satisfies the client’s business requirements • appropriateness for the target audience Following the above guidelines will ensure that the consumers of an API will be able to understand it. Moreover, integration and usage will become quite easy. The easier the API is to consume, the higher the adoption rates will be and the lower the integration costs.

www.todaysoftmag.com | no. 39/september, 2015

15


programming API Design - A Case Study The power of example Let’s put the above considerations in practice and analyze a real-world API together with some of the challenges we faced throughout the API design process. The following examples are taken from a web service whose aim is to manage the promotions visible on our website. These promotions ask the customer to perform multiple types of actions on the site (such as registering, placing bets, playing arcade games), in order to receive one of the pre-configured type of rewards. In our organization, web services communicate with each other using an RPC-style protocol. In order to describe the operations supported by each service, we use a bespoke XML schema called BSIDL (acronym for Betfair Service Interface Definition Language). The BSIDL specifications are in XML format and describe the operations (or methods) the service exposes and the data types that are supported. Below is an example of the operation used by one of the APIs clients (the back office tool) to create a promotion. <operation name=”create”> <description>Creates a new promotion.</description> <parameters> <request> <parameter name=”promotion” type=”Promotion” mandatory=”true”> <description>The promotion to create.</description> </parameter> </request> <response type=”ResponseStatus”> <description>Return ok if it was a successful call and fail otherwise, together with an error code. </description> </response> </parameters> </operation>

It can be seen that the operation name is explicit, basically the name says what the operation does and it is hard to misuse having one parameter whose name is suggestively named promotion(expresses what we want to create) but it is powerful enough to satisfy the requirements. Up to this point we have an intuitive use and self-documenting operation. The main concern regarding this new interface was how to model a promotion such that it is easy to extend in the future, but at the same time avoids duplication as much as possible. The simplest and easiest way could have been to create a new type for each promotion, but this choice would have led to a number of disadvantages like duplicate fields - promotions have in common a series of characteristics like name, description; the final result will be an explosion of promotion types for each new kind of promotion that must be added. We were not fully happy with this approach and after a bit of thinking we came up with the idea of a promotion type which has all the fields necessary for describing a promotion with a special field called fulfillmentCriteria. An excerpt of the promotion type can be seen below. <dataType name=”Promotion”> <description>Encapsulates the promotion entity fields.</description> <parameter name=”name” type=”string”> <description>The name of the promotion.</ description> </parameter> <parameter name=”rank” type=”i32”> <description>Represents the promotion ranking number which is an integer on range[1,1000]. </description> <parameter name=”product” type=”set(Product)”>

16

no. 39/september, 2015 | www.todaysoftmag.com

<description> Indicates the products for which the promotion is available. </description> </parameter> <parameter name=”fulfillmentCriteria” type=”FulfillmentCriteria”> <description>What does the user need to accomplish in order to get the reward. </description> </parameter> </dataType> 1 The solution to the multiple types of promotion problem was to use composition at the API definition level. For example, instead of creating a new promotion type for promotions that require a deposit (e.g. deposit 10 EUR to get a free bet) we created a new criterion called DepositCriteria which encapsulates the 10 EUR deposit requirement. This makes the API easy to extend without any breaking changes when adding new types of FulfillmentCriteria with the advantage of having a single promotion type.

<dataType name=”FulfillmentCriteria”> <parameter name=”compoundCriteria” type=”CompoundCriteria”/> <parameter name=”depositCriteria” type=”DepositCriteria”/> <parameter name=”placeBetCriteria” type=”PlaceBetCriteria”/> <parameter name=”registerCriteria” type=”RegisterCriteria”/> </dataType>

The addition of the CompoundCriteria was necessary for the cases when a promotion would have been configured to have multiple criteria in the same time using operator types AND,OR describing what the Betfair customer needs to do. This is how the CompoundCriteria tree looks like if we will have a promotion with the following requirements: Register now then play 5 EUR on Arcade games or place a bet of 5 on Romania vs Hungaria to get a free bet. Regarding the error handling, it can be seen from the first example that the create operation returns a data type calledResponseStatus. The promotion is validated at creation time and all inconsistencies are encapsulated and reported in the returned ResponseStatus object. We approached this solution because we think it is more appropriate and consumer friendly and as Martin Fowler said: If a failure is expected behavior, then you shouldn’t be using exceptions. The client in this case verifies the success flag and only if the response is negative checks the errorCode, otherwise does nothing. As simple as that. Based on the error code received, the


TODAY SOFTWARE MAGAZINE client can decide what to do. <dataType name=”ResponseStatus”> <parameter name=”success” type=”bool”/> <parameter name=”errorCode” type=”string”/> </dataType>

Even when the guidelines are followed when designing an API mistakes can be made. New requirements arrive all the time, therefore new attributes describing the promotion were added. Promotion getPromotionName() getRank() getProduct() getDisplayAttributes() getJurisdiction() getVisibleForGuest() getTermsAndConditions()

Some of the attributes were grouped under new data types with suggestive names. DisplayAttributes getTheme() getBannerUrl() getImageUrl()

Others were added directly without being grouped because we didn’t find at that moment a suitable group and adding a single attribute in a group would not make sense. Now, as a consequence, promotion type attributes grew a lot and even if we found a possible group for some of the attributes (we could group rank and product into something similar toDisplayAttributes), API client already uses this version and it is quite hard to make breaking changes.

Conclusions Designing an API is a challenging activity. What we have learned from this experience is that even if not all the requirement changes can be predicted all the time, it is a good practice to try to anticipate the future specifications because, in this way the API will be easier to extend and there will be less breaking changes. Another lesson learned is that doing things right from the first time is not always possible, but it is important to be able to recognize and fix problems as soon as possible.

www.todaysoftmag.com | no. 39/september, 2015

17


programming

Low latency FIX engine in Java

C

hronicle FIX is our Low Latency FIX engine and database for Java. What makes it different is that it;

Peter Lawrey peter.lawrey@highfrequencytrading.com CEO @ Higher Frequency Trading Ltd

• is designed for ultra low GC* in Java. • supports Strings and date times in a way which minimises garbage and overhead. • is customisable to include only the fields you expect. • uses optimisations normally used in binary parsers and generators such as reading/writing 4 or 8 bytes at a time to improve efficiency. • built on low latency persistence to minimise the latency of logging. • is optimised for low latency network cards such as Solarflare. * Ultra low GC means it can produce less than a byte of garbage per message on average If you keep your total garbage rate to less than 1 GB per hour a 24 GB Eden can take all day to fill up and you don’t get any minor GCs. Produce less than 200 MB/ hour and you can run for a week without a GC.

But isn’t Java slow? Java can be slower than C++ but written well Java can be faster than a C++ application not written so well. i.e. Just because something is written in C++ doesn’t guarantee it will be faster.

What is being tested?

to native memory. e.g. ready to write to a Socket Channel. Note: Strings and Timestamps fields are the most expensive. There are 6 Strings and two timestamps. JMH configured to use SampleTime was run for 10 minutes in each test. This graph shows the latency of parsing and generating a moderately sized FIX message. In both parsing and generating, the latency was less than a micro-second, more than 99.9% of the time. But what about the higher percentiles? These don’t look as good. This is because the machine I am using has some noise from the OS such as interrupts which I have minimised but can’t turn off. The higher delays are caused by the OS. Around once a milli-second there is an interrupt for about 2 micro-seconds and even rarer delays of 5 and 7-8 microseconds. On a better tuned server I will still expect there to be interrupts, but they would occur less often.

The „Parser test” times how long it takes to parse a 214 byte New Order Single FIX message in native memory eg. after reading from a SocketChannel and set all the values of the fields into an object. In this test, the textual fields are set with Strings as this is the more natural way to deal with text data in Java. We have alternatives which are faster such as support for 8 bit character strings. The „Generator test” times how long it What is next? takes to generate the 214 byte New Order The next step is to performance test Single FIX message from data which con- integration with Chronicle Journal to tain Strings, and timestamps and write it see the impact of persistence. Journal

18

no. 39/2015, www.todaysoftmag.com


programare

TODAY SOFTWARE MAGAZINE

is a specialised persister which is similar to Chronicle Queue v4 but have been tuned for specific use cases. In this case, we need Journal to not only persist at around 150 nano-seconds per message, but have a higher consistency than Queue. While Queue performs very well writing to SSD, around 1 in 1000 to 1 in 100 writes will have a signature delay which reflects the choice of disk subsystem you have. i.e. it directly impacts the 99.9% latency. What we can do with Journal is buffer this delay to significantly reduce the impact.

and tune the code to get the benchmark? Is this something users would naturally do when writing their code? So the question, is Chronicle-FIX the fastest FIX engine is somewhat irrelevant. What we certainly know is that we are in the right ball park. Most importantly, the way Chronicle-FIX is licensed with consulting to ensure it is optimised for your use case, we will work with you to make sure that your code can achieve the sort of results we published in the benchmark.

What is a FIX Database?

The source for Chronicle FIX is on github but only available to those with a license. The thinking is that if you need a very fast FIX Engine (measuring your times in sub-microseconds) we can help integrate it into your software in the most optimal way for you. It may be that you are tied into an existing data model and code base in which case we have techniques which vastly reduce the cost of transforming data - in fact we don’t even hold an intermediary data model. On a green field project we can show you how to best build your code around Chronicle-FIX.

MongoDB is a database optimised for JSON messages. Chronicle FIX is a database optimised for FIX messages. It stores data in FIX and support queries on FIX fields such as; give me all the messages for a client order ID, or give me all the messages sent a specific time, or give me the messages most delayed between transmission time and the time we received them.

Is Chronicle-FIX the fastest FIX engine for Java code? We’ve seen a number of benchmark stats quoted for various FIX engines. Whilst benchmark numbers give you a general insight into the order of magnitude in which you dealing they almost certainly don’t give you an exact idea as to how fast your code will run. It’s easy for anyone to claim that they have the fastest FIX engine with some benchmark figures to back it up but very hard to actually compare like for like. Benchmarks will always be optimised to suit the software against which it is being run. So what exactly is a fair test for all engines? Even if you find a fair test on which everyone agreed how much do you have to manipulate

How to use Chronicle FIX?

Conclusion Chronicle FIX is quick. While QuickFIX struggles to be under 50 micro-seconds to parse + generate, Chronicle FIX is comfortably under two micro-seconds to do both, most of the time. We will be providing more documentation on how persistence performs and the database works.

www.todaysoftmag.com | no. 39/september, 2015

19


programming

jOOQ, for the simplification of SQL integration into Java

j

OOQ is a Java library used for mapping the data bases. The thus resulted API is domain-specific (DSL), representing an abstraction built on the relational and object oriented models (ORM) of the data bases. As it is object oriented, it is type safe.

Silviu Dumitrescu silviu.dumitrescu@telenav.com Engineer manager @Telenav

Diana Bălan diana.balan@telenav.com Java developer @Telenav

20

no. 39/2015, www.todaysoftmag.com

jOOQ does not represent a new interrogation language, but a tool for building the SQL clauses from jOOQ objects generated from the data base. jOOQ uses JDBC to the calls on the data base resource. Though jOOQ does not have as many functionalities as ORMs (for instance: the management of entity states, inheritance, polymorphic interrogations, etc), it allows the creation of complex interrogations that imply reunions, aliases, imbricated selects or complex junctions, meaning that it covers the extended functionality of SQL. The main artefacts generated as predefined structures, but which can be modified and adjusted on the model and accessibility level, for jOOQ are: • Keys.java, which contains the primary, foreign keys and the referential identities as static members, the instance of the org.jooq.Key class; • Tables.java, which contains all the table objects as static members, the instance of the org.jooq.Table class; • Objects defined by the user: • an extension of the org.jooq. impl.SchemaImpl class, which contains an array of all the tables of the data base; • an extension of the org.jooq. impl.TableImpl class, which defines the structure of a table in the data base. One such extension appears for each table in the data base; • an extension of the org.jooq. impl.UpdatableRecordImpl class, which defines the operations of display and alteration of an entry in a table. Such an extension appears for every table in the data base. We will use as a demo for this article

the default generation for a Postgre SQL data base. In a Maven project, pom.xml is going to have the following content: <dependencies> <dependency> <groupId>org.jooq</groupId> <artifactId>jooq</artifactId> <version>3.6.1</version> </dependency> <dependency> <groupId>org.jooq</groupId> <artifactId>jooq-meta </artifactId> <version>3.6.1</version> </dependency> <dependency> <groupId>postgresql</groupId> <artifactId>postgresql </artifactId> <version>9.1-901-1.jdbc4 </version> </dependency> <dependency> <groupId>org.postgis</groupId> <artifactId>postgis-jdbc </artifactId> <version>1.3.3</version> </dependency> </dependencies> <build> <plugins> <plugin> <groupId>org.jooq</groupId> <artifactId> jooq-codegen-maven </artifactId> <version>3.6.1</version> <configuration> <executions> <execution> <goals> <goal>generate</goal> </goals> </execution> </executions> <!-- JDBC connection parameters--> <jdbc> <driver> org.postgresql.Driver</driver> <url> dbc:postgresql://localhost:5432/ mydatabase</url> <user>username</user> <password>password</password> </jdbc> <!-- Generator parameters --> <generator> <name>


programare org.jooq.util.DefaultGenerator present in the application) </name> <database> <name>org. • for a pure jOOQ application, we will create: jooq.util.postgres .PostgresDatabase</name> DSLContext create = <includes>.*</includes> DSL.using(conn, <excludes></excludes> SQLDialect.POSTGRES_9_4); <inputSchema>myschema </inputSchema> </database> The classes involved are: DSLContext is the interface contai<target> <packageName> ning the main features for the interrogation object, and DSL is a test.generated</packageName> factory for different types of dialects; <directory>src/main/java </directory> • the creation of the interrogation is easy, by calling methods </target> from the previously created object; </generator> </configuration> • the result of an interrogation is a Result, similar to a </plugin> ResulSet of JDBC. We present below the entire code of this </plugins> </build> demo application:

The first two dependencies, jooq and jooq-meta, are used as basic packages for running jOOQ, respectively for the metadata used in the mapping of the data base in Java classes. The third jOOQ dependency, jooq-codegen-maven, is a basic operating system for the actual generation of the data base layout. Other important tags involved in pom are:

final String userName = „postgres”; final String password = „fcdss”; final String url = „jdbc:postgresql://localhost:5432/ mytests”; try (final Connection conn = DriverManager. getConnection(url, userName, password)) { final DSLContext create = DSL.using(conn,SQLDialect. POSTGRES_9_4); final Result<Record> result = create.select(). from(Tables.AUTHOR).fetch(); for (final Record r : result) { final Integer id = r.getValue(Tables.AUTHOR.ID); final String firstName = r.getValue(Tables.AUTHOR. FIRST_NAME); final String lastName = r.getValue(Tables.AUTHOR. LAST_NAME); System.out.println(„ID: „ + id + „ first name: „ + firstName + „ last name: „ + lastName); } } catch (final Exception e) { e.printStackTrace(); }

• jdbc, which contains the metadata of connection to the data base; • generator, with the sub-tags: • database, which establishes the dialect used from jooqmeta. The name is created after the default construction: • org.util.[numeVendor].[NumeVendor]Database • includes, which establishes, in the form of some regular Java expressions (the expression separator being the pipe), the items that are going to be generated from the data base schema; We shall develop the subject in the future numbers of the • excludes, which establishes, in the form of the same magazine, with performance arguments and a parallel between regular expressions, the items excluded from the general jOOQ and ORMs such as JPA. mapping (it may include table names or routines); We hope you have enjoyed the article! • target, with two sub-elements: ◊ packageName, representing the name of the package where the classes mentioned in the previous paragraphs will be generated; ◊ directory, representing the name of the directory where the previous packages will be created. An application that interacts with a PostgreSQL data base, which contains a table, takes the following steps: • the creation of a connection, instance of the Connection class, from java.sql (this is actually the single JDBC element

www.todaysoftmag.com | no. 39/september, 2015

21


programming

OSM and Telenav: through the eyes of a Map Analyst

A

s you may already know, Telenav uses crowd-sourced OpenStreetMap (OSM) data to bring to its customers one of the best navigation services out on the market. We have chosen the OSM model, because the edits are published every minute, resulting in maps that are often more detailed and more up to date than commercially available maps.

Florin Badita

florin.badita@telenav.com software developer @ Telenav

OSM, just like Wikipedia, is the only crowd-sourced and open-sourced map of the globe and, for many developers and passionate mappers, it has become a clear alternative to Google Maps. The community has doubled year over year to more than 2.2 million registered editors, with people mapping every country around the world, ranging from the U.S. to Germany and Lesotho to North Korea. For example, newly laid streets and newly developed areas can be updated on a regular basis and in real time. In addition, OSM allows for greater map detail for pedestrians such as alleys, sidewalks, parks, hiking trails, zoos, and even city trees. Telenav has been an active contributor to OSM for more than five years, working closely with the community to enhance specific features needed for navigation, traffic and other future location-based services.

Mihai Iepure mihai.iepure@telenav.com software developer @ Telenav

Silicon Valley - 2007 vs. Now

Gabriela Sinka

gabriela.sinka@telenav.com map analyst @ Telenav

22

no. 39/2015, www.todaysoftmag.com

In regards to Telenav’s contribution to the OSM platform, it was more than welcome for a dedicated team to be a gatekeeper of the OSM idea. As we have an active role in the company’s map data generation roadmap, we build frameworks for high frequency map updates and we

analyze the map to provide an overview on the map data set and to assess the quality of the map. So, the main challenge for us is to find the best ways to accomplish that by using internal and openly available GIS tools and libraries. To put this into practice, we use relational database management tools like: • PostgreSQL and PostGIS to manipulate spatial data, • QGIS for data viewing, editing and analysis, • JOSM (Java OpenStreetMap Editor), the main offline editor for OSM that we use to edit the building blocks of the OSM database: nodes, ways, metadata tags and relations. Also, osmosis, osmconvert, osmfilter and overpass turbo come in handy when we want to filter and convert data files for specific map objects. We analyze the map, searching for repeating patterns related to different bugs that exist on the map. We are always searching for new ways in which we can detect errors, in a programmatic or visual way. Here is an example on how a mapper has to deal with a mapping job: we created a style map in QGIS that highlights the areas where there are a lot of nodes, packed close one to each other, by duplicating the nodes layer and by setting the Layer blending mode to burn, causing the nodes to become more yellow, as more nodes are overlapping in an area. We could also do this in a more programmatic way, counting the length between each segment and setting a threshold, show only the linestrings that have 10 consecutive nodes with a distance between each node smaller than 20 centimeters.


programare

TODAY SOFTWARE MAGAZINE focus on are: improving the Canadian road map, maintaining the USA data and also preparing to take full advantage of the recently released road data by the Mexican National Institute of Statistics and Geography (INEGI).

Yellow areas mean higher node density; the size of the grey circle is proportionate with the number of node edits; the green area represents the number of line edits; the dark red areas show the number of tags attached to each linestring.

Other tools that help the collaboration with the community are MapRoulette and OSM Tasking Manager. MapRoulette is a gamified approach to fixing OSM bugs; it breaks common OSM data problems into micro tasks that can be solved in no more than 3 minutes. Tasking Manager has the same purpose, to divide mapping jobs into smaller tasks. It is helpful in case of an emergency, distributing tasks to various mappers. Some of our projects that we currently

The INEGI database contains spatial information regarding the administrative divisions in Mexico and road network files. The latter provides a unique ground transport network that integrates national highways and a detailed road map of all localities. OK, but how exactly do we “exploit” this valuable resource? How can we merge the rich data that OSM already has in many places, which we obviously want to keep, with the INEGI dataset? The process of enhancing the OSM map is not straightforward. Let’s have a look at an example, San Angel Zurumucapio, a small locality in the middle of Mexico. OSM has only the main traffic arteries (left image), and if we look at Bing aerial imagery (right image),

it’s clear that almost the entire settlement is not mapped. In this case, INEGI has most if not all the roads in this locality in their open dataset. In order to be on the same page, the INEGI data attributes have to be converted to OSM-appropriate tagging. Next step would be to merge the two datasets (preexisting OSM data and INEGI) with our internal tool. The tool takes as its input a base OSM file as well as the INEGI enhancing file; it will then compare and conflate the two and propose a set of changes to the base OSM data in an output file that can be imported into JOSM. Even though the tool does a very good job merging the OSM data with the enhancing file, a manual cross check is still needed before the final upload to avoid bugs like: extraneous edges, overlapping or duplicated roads and connectivity errors. This kind of task, due to its size, needs a big amount of work that can’t be done by a small team of map analysts, this is where the collaboration with the OSM community is vital, through deploying Tasking Manager jobs and MapRoulette tasks. If this subject caught your attention, you are more than welcome to our OSM gatherings (organized once a month: http://www.meetup.com/Cluj-NapocaOpenStreetMap-Meetup/) to find out more about OSM and to join this groundbreaking, collaborative effort.

www.todaysoftmag.com | no. 39/september, 2015

23


programming

BDD by Cucumber

I

t seems a new test framework is gaining traction on the internet (especially in the Java area) reviving the concept of BDD. Cucumber is a software tool for running automated acceptance tests in a business-readable domain-specific language. BDD or Behavior-Driven Design, however, has been around for a while, the first articles

Sergiu Indrie sergiu.indrie@iquestgroup.com

and projects (JBehave [5] and RSpec [6]) appearing in 2007. As mentioned on the site of the project, Cucumber is a rewriting of the previous two frameworks.

Senior Software Engineer @ iQuest Group

Concepts BDD

then can we expect to obtain value from it. BDD was created out of a need for better collaboration between business people, developers and testers. If we want to profit from using this process we need to start with the idea of a joint effort between all stakeholders.

The most important concept to grasp Cucumber Test in this article is the concept of BDD. A Cucumber test requires the following Behaviour-Driven Design is not just about 3 items: choosing a relevant test framework and 1. a feature file start writing tests, it’s about really under2. step definitions standing the idea behind this development 3. business code process (See articles [7] and [8]). Only

24

no. 39/2015, www.todaysoftmag.com


TODAY SOFTWARE MAGAZINE Feature File A feature file is a plain text file written in Gherkin language, Step definition Java files can also use @Before and @After a business-readable domain-specific language that allows the hooks similar to JUnit and a custom reporting mechanism by description of the application’s behavior in free text. injecting a Scenario object where steps can output text or even Below is a sample feature file image resources. Feature: Refund item Scenario: Jeff returns a faulty microwave Given Jeff has bought a microwave for $100 And he has a receipt When he returns the microwave Then Jeff should be refunded $100 The feature file is composed of at least one scenario (which is essentially a test) which is in turn composed of at least one step. Feature files can also have different supporting constructs like descriptions, comments, tags, a before hook and different ways to parameterize scenario steps.

Step Definitions As we saw above, a scenario is composed of multiple steps like “Jeff has bought a microwave for $100” and “he has a receipt”. All those steps are plain text abstractions of supporting code also called glue code. In order to support the first step, we need to define a Java method like the following

Business Code Last, the step definition code needs to work with the application business code.

Tools

From the language point of view, Cucumber is very flexible, supporting all of the major programming languages like Java, .NET, C++, PHP and others. As for the Java side of things, there are 2 artifacts available: one for Java 8 and one for previous versions. Some of the main supported frameworks are Spring, Selenium and Ruby on Rails. Even though the framework is not extremely popular, it has been supported by the main Java IDEs for a while now (Intellij IDEA 12 and up; Eclipse starting with January 2014). With features such as syntax highlighting, step autocompletion, step navigation, step usage, step stub generation and test run, Cucumber development is fairly easy. Maven integration is straightforward for basic usage (provided

@Given(„^Jeff has bought a microwave for \\$(\\d+)$”) public void Jeff_has_bought_a_microwave_for_$(int amountOfMoney) { business. buyMicrowave(amountOfMoney); }

The Gherkin step is matched to the Java method by using regular expressions. In this case the regex „^Jeff has bought a microwave for \\$(\\d+)$” will match “Jeff has bought a microwave for $100”. Notice that the microwave price is extracted as a regex group. This is the mechanism that Cucumber uses to extract variables from the free text specification. The entire Java step definition file can be found below public class RefundSteps { private Business business = new Business(); @Given(„^Jeff has bought a microwave for \\$(\\d+)$”) public void Jeff_has_bought_a_microwave_for_$(int amountOfMoney) { business. buyMicrowave(amountOfMoney); } @And(„^he has a receipt$”) public void he_has_a_receipt() { business.hasReceipt(); } @When(„^he returns the microwave$”) public void he_returns_the_microwave() { business.returnMicrowave(); } @Then(„^Jeff should be refunded \\$(\\d+)$”) public void Jeff_should_be_ refunded_$(int amountOfMoney) { business.refund(amountOfMoney); } } www.todaysoftmag.com | no. 39/september, 2015

25


programming BDD by Cucumber you use an empty test class annotated to run with Cucumber and place all artifacts in the same package) but more advanced use cases could benefit from a dedicated pure-Java Maven plugin (see [12]). (It may also be the case that your hierarchical feature file structure is more high level and thus different from your step definition package structure)

property to the maven-surefire-plugin Using the exec-maven-plugin <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>exec-maven-plugin</artifactId> <version>${exec-maven-plugin.version}</version> <executions> <execution> <phase>test</phase> <goals> <goal>java</goal> </goals> <configuration> <classpathScope>test</classpathScope> <mainClass>cucumber.api.cli.Main</ mainClass> <arguments> <argument>--format</argument> <argument>${format}</argument> <argument>--strict</argument> <argument>--glue</argument> <argument>target/test-classes</ argument> <argument>target/test-classes/.</ argument> <argument>--tags</argument> <argument>~@ignore</argument> <argument>--tags</argument> <argument>${tagArg}</argument> </arguments> </configuration> </execution> </executions> </plugin>

Using the maven-surefire-plugin

A Java test class that will run all features in the same package package com.tsm.bdd; import cucumber.api.junit.Cucumber; import org.junit.runner.RunWith; @RunWith(Cucumber.class) public class RefundTest { }

The approaches to running Cucumber tests with a more complex setup using Maven are ● use the exec-maven-plugin to call the Cucumber main class and pass the needed arguments ● select the test suite using the relevant Java test class and package and pass the needed Cucumber options as a system

<plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-plugin</artifactId> <version>2.18.1</version> <configuration> <test>${java.test}</test> <systemPropertyVariables> <cucumber.options> --monochrome --strict --plugin pretty --plugin html:..\logs\report\htmlreport-java --plugin json:..\logs\report\jsonreports\${json.name.java} --plugin junit:..\logs\report\junitjava.xml --tags ~@skip </cucumber.options> </systemPropertyVariables> </configuration> </plugin

It is worth noting that Cucumber can also be integrated with Jenkins with the help of plugins.

ITea Afternoon 2nd edition #availability

#maintainability

#supportability

#reliability

Make your IT Architecture stand out from the crowd! 7-8 October

2015 26

no. 39/september, 2015 | www.todaysoftmag.com

Hotel Plaza Târgu-Mureș


TODAY SOFTWARE MAGAZINE Observations From a BDD perspective, Cucumber doesn’t add any major contribution especially when compared to JBehave (see [11]) which takes a very similar approach. Overall, Cucumber seems to serve its purpose and provide easy collaboration between the involved parties with the use of the Gherkin language, and as a side-effect enhance the readability of developer written tests. However, from a programmer point of view, the tool feels not quite as mature with small gaps on test specification and writing (see [9]), unfinished documentation (see [10]) and complexity in configuring a unified way to run acceptance tests (Maven vs IDE).

References 1 https://en.wikipedia.org/wiki/ Behavior-driven_development 2. http://dannorth.net/introducing-bdd/ 3. https://cucumber.io/ 4. https://github.com/cucumber/cucumber/wiki/Gherkin 5. http://jbehave.org/reference/stable/index.html 6. http://rspec.info/ 7. http://www.javacodegeeks.com/2015/04/ pitfalls-of-cucumber-adoption.html 8. http://www.javacodegeeks.com/2013/12/ acceptance-testing-blaming-the-tools.html 9. https://www.coveros.com/ background-and-hooks-for-cucumber-jvm/ 10. https://cucumber.io/docs/ reference#doc-string-argument 11. http://mkolisnyk.blogspot.ro/2013/03/jbehave-vs-cucumber-jvm-comparison.html 12. https://github.com/cucumber/cuke4duke/wiki/maven

www.todaysoftmag.com | no. 39/september, 2015

27


testing

Become a better tester with BBST

W

hich is the last thing you’ve read in order to improve your testing knowledge? How do you exercise the necessary skills in your activity? Just as in other work fields, it is important for testers to be in continuous learning mode, in order to adapt to the new concepts that the technologic advance brings along, but also to improve their approaches, techniques and testing practices in a competitive environment. Change of perspectives is a daily routine in an environment that is constantly evolving, so professionals need to be up-to-date with paradigm changes that take place in their work field. An important aspect in everyone’s career is represented by the skills developed along the way. Working in testing, we know how important it is for the testers to benefit from continuous development in order to be up-to-date with new technologies, but also to be able to communicate properly with their partners when encountering issues. Until some years ago, the possibilities for testers to develop new skills were quite limited, but Cem Kaner came up with a solution: alternative courses that don’t make students only memorize certain terms that they don’t actually understand, but they also go into details that make students develop their critical thinking. The solutions that are offered are not generally valid, but the key aspect in all this is a deeper understanding of the context in which the testing process takes place. These courses that have been created and are continuously developed by Cem Kaner and Rebecca Fielder are BBST aka the Black Box Software Testing. How are these courses different? We will tell you: • The courses are held online, so flexibility is one big advantage; • Students receive individual feedback from their instructors as well as from other students, to maximize each individual’s learning experience; • Each course contains an Interactive grading session for an assignment or the final exam, receiving coaching based on their work; • Students are encouraged to challenge their current knowledge as well as the course materials, providing them with the opportunity to clarify concepts and to practice their critical

28

no. 39/september, 2015 | www.todaysoftmag.com

thinking skill; • Participants receive additional bibliography for each lesson; • The courses are delivered by instructors with strong testing background, so that the feedback in the course is focused on providing applicable knowledge. After presenting a series of benefits that the BBST courses have, it is high time to tell you what is taught during these courses. Each course is carefully designed to build up skills which will be used in subsequent courses, so each one is a prerequisite for the next. This way we aim at providing the most effective learning experience for our students and to help them practice their skills so that they are ready to apply them when faced with challenges in their testing work. The first course of the series is BBST Foundations, which is organized around four critical challenges in software testing: what the mission of a testing effort is and how the project strategy helps achieve that mission; how a tester can determine whether or not the program has passed a test; what the key challenges in developing and using software metrics are; how we can measure the amount of testing that has been done and estimate the amount of testing that remains and how we can decide when to stop testing. The next course is BBST Bug Advocacy, which helps develop skills in effective bug reporting. The course applies lessons from sales, psychology and law in order to help students understand and present their reports more credibly and more persuasively and also to better assess the quality of troubleshooting and the effectiveness of reports written by staff or colleagues. Throughout this course, students will get to review and report bugs for a real


startups

and well-known software product and will practice hands-on their bug reporting skills. The third is BBST Test Design. After supplying an overview of seventy-five test techniques, the students will do a more deep analysis of six of them: function testing and testing tours, risk-based testing, scenario testing, spec-based testing, domain testing and combinatorial testing. All these lay a solid foundation for context-appropriate test planning.

Which are the main activities that are held during the courses? First of all, orientation activities, time in which the student is having a review on different themes before seeing the lesson, in order to analyze different context and ask questions before seeing the answers presented in the lesson. The second activity is applying the techniques students have dealt with during the sessions. The third activity is the quizzes that help students consolidate the terms and prove that they have actually understood what they’ve learned. Even though the quizzes are evaluated by the instructors, the grades are not part of the final evaluation. Discussions are also part of the process: whether they are interpersonal (between the student and the instructor), or group ones, they are important for brainstorming and exchanging impressions on what everyone understood on a certain topic.

At the end of each course series, students have to take a test and the grading will be interactive. The instructors are Ru Cindrea, Alexandra Casapu and Gabi Dobritescu, each of them gaining this title by taking the BBST series and the Instructors’ course, working closely with Cem Kaner and Rebecca Fiedler. One important detail for the courses is the length: they spread over four weeks, as we already mentioned, they take place on-line, giving flexibility to the students and enough time to understand terms and concepts related to testing. Completion of the full course series is rewarded by a printed certificate signed personally by the instructors. Another plus of the BBST courses is that the number of students is limited, rising the degree of interaction between the students and the instructors, as well as between students. This is way better than having a class composed of hundreds of students. This November brings along a new BBST Foundations series, giving the opportunity to another group of students to discover a new side and perspective of testing. Altom is offering to a Today Software Magazine reader the opportunity to take the BBST Foundations course for free by participating in a contest: post on Facebook or Twitter your expectations from this course using #BBSTAltom. Deadline for the contest is October 12! Disclaimer: Ex-participants to the BBST Foundations courses organized by Altom cannot participate in this context.

Monica Rațiu monica.ratiu@altom.ro Marketing Specialist @ Altom

www.todaysoftmag.com | no. 39/september, 2015

29


programming

Code for a space full of joy

A

t age 13, prodigy Richard Sheridan first came into contact with a computer. It was the moment he knew that he was going to spend his entire life programming. However, his experience in the software business taught him that for many employees, working in this industry meant endless hours of poorly coordinated projects, with unsatisfactory results. After almost thirty years, he decided it was time to find a better way. Alexandra Banu alexandra.banu@cos.ro Marketing & PR Responsible @ COS

30

no. 39/2015, www.todaysoftmag.com

Thus, in 2001, he founded Menlo, a design and software development company, with a clear intention: to create an organizational culture based on a business value called „Enthusiasm”. Six years later, Menlo reached Top 500 of Inc.com as one of the fastest growing private companies in the US. In 2013, the company headquarters, located in a former parking lot in Ann Harbor, Michigan, was visited by over two thousand people from all over the world, eager to discover more about the company. Their interest was not in the technology used by Menlo, but in how they were addressing organizational culture and workspace design. Menlo had so many requests for guided tours, that the CEO realized that it was time to share their story in a different way. This is how the book „Joy, Inc : How

We Built the Workplace People Love,” was born. Joy captures Sheridan’s desire to change an industry that he didn’t want to be part of anymore and the methods organizations everywhere can use to keep their team motivated and passionate at work. Best practices say that, in order to be efficient and to contribute to the company where they work, it requires for each individual to be physically separated from his teammates through a well-defined personal space. Walking around Menlo headquarters, one thing visitors notice is the very absence of closed offices or cubicle walls. Moreover, most workers do not have their own desks, chairs and computers. Visitors are often surprised by this unconventional design, which doesn’t allow employees to display family photos or personal objects. What does Menlo


management say about this? If they want to see their loved ones, employees are free to bring them at the office. The company has created special spaces for rest and care, and so far, five children have already been raised at Menlo. Pets are also welcomed. Menlo uses the same techniques that Edison has invented 130 years ago: working collaboratively in an open space, developing software iteratively and gradually, aiming to have a small product launch every 10 days and a significant release every 6 months. Of course, as in the case of Edison, the main motivator is to create useful and marketable products that bring real business value. By working permanently in an open space, the team is performing better, faster and at reduced costs, all in the spirit of Edison’s original concept – The Invention Factory. Why do we recommend JOY? It’s a book about the courage to build a unique working space in the name of enthusiasm. By reading JOY, you will get familiarized with the system of values and beliefs of a highly performant company and understand how an office space that seeks to eliminate stereotypes can be a strong basis for a sustainable business model.

Young spirit Mature organization A shared vision Join our journey! www.fortech.ro

www.todaysoftmag.com | no. 39/september, 2015

31


marketing

Online Marketing Specialist Vs. Marketing Agency – Which is best for you

O

Călin Biriș calin.biris@loopaa.ro Digital Director @ Loopaa

nline Marketing can’t be ignored anymore. Before making any purchase decision, the consumers are doing online research and are getting more informed than ever. Google did a market research and found out that 92% of the consumers turn to search engines when looking for a local business. So it is necessary for any company to have a good online presence. If you want to reach your Marketing goals there are two options: have an Online Marketing Specialist in-house or work together with a Marketing Agency.

Online Marketing Specialist Vs. Marketing Agency

Let’s see what are the pros and cons for each option:

Online Marketing Specialist (OMS) in-house Pros • The OMS will get to know everything about your business, even the inside jokes; • If you want to change something very fast (like at that moment), your OMS will be always there for you; • The OMS can help you also with other minor things that need to be

32

no. 39/2015, www.todaysoftmag.com

done and that are not necessarily his responsibility; Cons • If your OMS will leave your company, you will have to hire and train a new one. That will take some time and money to get the same results the previous specialist got; • It’s hard or almost impossible to have an Online Marketing Specialist that has all the skills that you will need for implementing your Online Marketing Plan: HTML, design, SEO, Pay Per Click campaigns, Social Media Marketing, blogging, email marketing, Analytics,


startups CRO etc.; • Some tasks will take a lot of time to get done, because of the learning curve; • You only get one perspective for your online presence, and that can lead to a shortage of creativity; • You pay a lot of extra salary taxes and benefits;

Marketing Agency Pros • You have a team at your disposal that can cover everything you need for your Online Marketing; • The Online Marketing Specialists from the agency know many insights from other industries, and can use this knowledge to improve your business results; • You will benefit from improved instruments (such as reports, industry analysis, etc.) that an in-house marketing specialist can’t develop by himself; • You pay only for the services you get without any salary taxes. This can lead to a more efficient investment on the long term; • If the agency has other offline capabilities also (like we have) it can help you

TODAY SOFTWARE MAGAZINE with more than just Online Marketing; Cons • The OMS from the agency won’t get to know your business as good as an inhouse OMS; As you can see, there are some advantages and disadvantages for both options. But do you really have to make a choice? The truth is that those options don’t have to exclude each other. It is a good practice to have an in-house Marketing Specialist or Brand Manager that coordinates the collaboration with the Marketing Agency. This will help your company get the best from both sides. If you have a business that affords to have its own Online Marketing Team (2 to 6 specialists at least), not just an Online Marketing Specialist, then a Marketing Agency can help you with an outside perspective on how you can improve your Online Marketing Tactics and Strategy. Our advice is to choose wisely and find out all your options. Try not to miss out on good opportunities to grow your online presence.

www.todaysoftmag.com | no. 39/september, 2015

33


education

How to increase our level of happiness

W

ho wouldn’t like to have: Increased work performance, Stronger interpersonal relations, Fewer negative psychological emotions, A higher level of prosocial behaviors? All of the above is associated with an increased level of happiness. But how can we develop our level of happiness on the long run? We would like to share with you some suggestions taken from the dedicated literature. Cristina Vâjâean

cristina.vajaean@happy-employees.eu Research Specialist @ Azimut Happy Employees

Did you know... The level of happiness is influenced by: • Genetic factors- 50% • The activities we undertake- 40% • Events in our lives-10% While we have no control over some aspects, we have total control over the activities that we choose to undertake.

What can we do? Even though the domain literature, which we will shortly present, can come up with useful scientific advice, it is up to us to: • Remain constant and try to apply these exercises every time we have the opportunity, for a longer period of time; • Stay away from monotony when choosing, and diversifying the activities we choose

34

no. 39/2015, www.todaysoftmag.com

• Understand their relevance and purpose, so that we can remain motivated when applying them • Choosing the right activities for us

How can we do this? • By expressing our positive emotions every chance we get; • Living in the present and enjoying every happy moment when it occurs; • Did we get some good news? Are we celebrating success? Let’s share it with our friends and colleagues! • Imagine what our best possible selves would look like – do we know what our goals are, what motivates us or how we would see ourselves in the our best case scenario? We recommend making a list to answer all of the above questions. This will help us arrange our goals and better understand


educație

TODAY SOFTWARE MAGAZINE Even if things won’t always go our way, the activities we choose to undertake will have the most impact on our happiness. So, we can improve the quality of our personal and professional life and start enjoying: • Better job performance • Stronger interpersonal relationships • Fewer negative feelings • A stronger prosocial behavior Good luck!

the steps we need to take in order to get there. Ex: I want to be a successful QA Clearly define what successful means. Imagine that you have achieved this goal, how does that make you feel? Clearly define what your action steps are: 1. ............. 2. ............. • Be grateful! This can help you better appreciate the happy moments and learn from the less pleasant experiences. • Rely on your strong points –it is important to identify them and start getting involved in activities which capitalize on them. Moreover, this can help select the specific qualities we want to develop.

www.todaysoftmag.com | no. 39/september, 2015

35


accounting

2016 PFA Taxation

I

Ioana Varga

ioana.varga@aiconsulting.ro Bookkeeper & Managing Partner @ A&I Consulting

36

no. 39/2015, www.todaysoftmag.com

n the 35th issue of Today Software Magazine, we brought to your attention some of the fiscal changes likely to affect the taxation of income derived from independent activities, as outlined in the draft amendment of the Fiscal Code, currently under debate. Considering that after heated debates and reviews in the Parliament, the final version of the New Fiscal Code was eventually final version, and now we can explain how published on September 10, we will take it will actually be implemented, providing this opportunity to resume the analysis of at the same time answers to some essential the changes and to draw some conclusi- questions. ons, pointing out how it could affect your 2016 budget. Although the final version of How Is The Monthly Calculation Base the Fiscal Code also refers to some chan- Determined? ges effective from 2017, in our opinion For self-employed individuals who it is premature to focus on them, given earn income from independent activities the obvious tendency to continuously and are taxed on net earnings basis, the revise and amend any statutory rule and monthly calculation base for retirement regulation. contributions is 35% of the average gross salary applicable in 2016. This base shall be used to determine Compulsory Retirement Contributions (Cas) the advance payments due to CAS and in Currently, self-employed individuals who earn income from independent 2017, after filing the tax return stating the activities do not owe contributions to the income earned in 2016, the monthly base pension fund on such income if they also shall be recalculated as the difference earn income from salaries. As of 2016, between the gross income and the business these persons shall also be insured under expenses incurred in carrying out the actithe compulsory national pension scheme. vity, excluding CAS expenses. The result This change of consequence on the acti- shall be divided to the number of months vity of every self-employed individual who with positive balance in 2016. The monthly earns income from independent activities base CANNOT be lower than 35% of the has been preserved from the draft to the average gross salary applicable in 2016, nor


educație higher than 5 times such amount. The same minimum and maximum limits shall also apply to those individuals who earn income from independent activities and are taxed on fixed income basis. For this category of self-employed individuals, the monthly calculation base of the retirement contributions represents the monthly fixed income rate divided to the number of months with positive balance; it cannot be lower than 35% of the average gross salary applicable in 2016, nor higher than 5 times such amount.

Who Will Be Exempted From Cas Advance Payments In 2016? The individuals who earned less income in the previous year (2015) than the minimum limit shall be exempted from advance payments to CAS. This exemption also applies to the professionals whose monthly fixed income rate in 2015 does not exceed 35% of the average gross salary.

What Is The Compulsory Cas Rate In 2016? The compulsory rate is 10.5% applied to the estimated or final calculation base. One can CHOOSE to pay the full rate of 26.3% based on a request filed before January 31st, 2016 for those who conducted business in 2015 or within 30 days from commencement of the activity for those who start the activity in 2016. The option to pay 26.3% shall be maintained throughout the entire the fiscal year and considered renewed for each year when it is not terminated by a request to return to the individual rate. Since the value of the average gross salary for 2016 is still unknown, we shall consider for exemplification purposes the corresponding value in 2015, i.e. RON 2.415, and provide a concrete example of the calculation method of this contribution and its impact. Average gross salary in 2015 = RON 2.415 Monthly minimum limit for advance payments: 35% * 2.415 = RON 845 Compulsory CAS rate = 10.5% Monthly minimum CAS rate: 10.5% * 845 = RON 89 Monthly maximum limit for the final payments: 5 * 2.415 = RON 12.075 Maximum monthly CAS rate: 10.5% * 12.075 = RON 1.268 According to this calculation method of the CAS final calculation base we can distinguish between two possibilities:

TODAY SOFTWARE MAGAZINE 1. If upon the adjustment it is found that earnings were below the minimum limit, the contribution paid in advance in 2016 shall not be refunded, but considered for the calculation of the retirement contribution and retirement score, and in 2017 the respective taxpayer shall not be subject to CAS advance payments. 2. If upon the adjustment it is found that the income was above the maximum limit, i.e. 5 times the average gross salary, the calculation base cannot exceed this level, and in 2017 the taxpayer shall continue to make advance payments to the CAS fund (we will find out from the Application Guidelines whether the calculation base for advance payments will be the income earned in 2016 or still the minimum limit of 35% of the average gross salary applicable in 2017.

Health Insurance Contribution (Cass) With reference to the health insurance contribution, the draft Fiscal Code proposed the annual adjustment of CASS for all the earnings obtained by an individual organised as PFA. As such, in the following year, the fiscal authority would determine the annual calculation base as sum of annual calculation bases subject to health insurance contributions. And this cumulative annual base could not exceed the annual maximum limit, i.e. 5 times the average gross salary multiplied by 12 months (annual limit for 2015: RON 144,900). Unfortunately, this adjustment related proposal has been approved to come into effect only from 2017; consequently in 2016 taxpayers shall owe health insurance contributions calculated against a base equating the positive difference between the gross income and expenses incurred in conducting the independent activity, excluding CASS expenses for self-employed individuals taxed on net earnings basis. For self-employed individuals taxed on fixed earnings basis, the monthly CASS calculation base is the annual fixed earnings rate, divided by the number of months with positive balance, for each source of income. The draft also included a positive change, namely to remove the condition related to the minimum limit representing one minimum gross salary per country in determining the monthly calculation base of the contribution. Accordingly, the persons

www.todaysoftmag.com | no. 39/september, 2015

37


accounting 2016 PFA Taxation with zero income would not have had the obligation to pay the contribution, and those who derived less income than the minimum limit, would have paid according to the actual earnings. Unfortunately not only did the approved Fiscal Code not carry forward this proposal, but on the contrary, it extends the scope of the health insurance obligation to self-employed individuals with zero income (regardless of the source: salary, pension, independent activities, property lease, investment, agriculture, other). In a nutshell, no-income individuals shall PAY MONTHLY CASS, equal to 5.5% of the minimum gross salary per country.

Cluj-Napoca

Second Edition Oct 14, 2015 | Golden Tulip Ana Dome Hotel

Speakeri Jacqui Banaszynski Are o experiență de peste 30 de ani ca reporter și editor în presa americană – a scris de pe toate cele șapte continente, inclusiv Antarctica. Seria „AIDS in the Heartland”, povestea unui cuplu de fermieri gay bolnavi de SIDA, i-a adus în 1988 premiul Pulitzer. În prezent, predă la Missouri School of Journalism, e editor la Poynter Institute și trainer pentru jurnaliști din toată lumea.

The Power of Storytelling

Income Tax The approved version of the New Fiscal Code features some changes related to tax income, as well. In our opinion, the most relevant are: Spunem povești ca să putem trăi, • the change of the fiscal loss reporca să ne vindecăm, ca să ne amintim, ca să vindem, ca să ting period from 5 years to 7 years; conducem. Vino să-i cunoști pe more importantly, please be aware that unii dintre cei mai buni cunoscători such reporting is allowed only in resai mecanismelor care fac poveștile pect to income tax, not also the health să funcționeze. contribution; • the deductible percentage of expenses incurred by contributions to professional associations shifts from Partener Platinum Parteneri Gold the current 2% applied to the calculation base to the maximum amount of EUR 4.000; • the expenses related to compulsory social contributions shall be deducted by the competent tax authority, upon the recalculation of the final net income or the annual net loss; Considering these new fiscal tendencies when it comes to the taxation of income derived from independent activities, we can conclude that they are aimed to gradually eliminate these forms of business organisation, since such a high level of taxation cannot be sustained on long term by a professional. We are heading towards a “re-conversion” to other forms or work and organisation, such as employment, copyright royalties, and eventually microenterprises. This decision to re-route the business organisation should be made in full awareness of all the effects involved, by means of a comparative analysis based on an estimated budget of income and expenses resulted from your professional activity.

38

no. 39/september, 2015 | www.todaysoftmag.com

Înscrieri pe www.thepowerofstorytelling.org/cluj

Chris Jones Scrie pentru Esquire US și ESPN The Magazine și e unul dintre vârfurile jurnalismului narativ. A câștigat două premii la National Magazine Awards: pentru „Home”, povestea a doi astronauți blocați în spațiu, și „The Things that Carried Him”, care reconstituie călătoria trupului unui soldat ucis în Iraq.

Alex Gâlmeanu Unul dintre cei mai importanți fotografi români, a publicat în majoritatea revistelor din România și a fotografiat pentru campanii publicitare naționale și internaționale. E interesat de istoria fotografiei și poveștile spuse de fotografiile de arhivă, experimentează și caută constant noi modalități de expresie.

Starlee Kine Om de radio dar nu numai, este producătorul Mystery Show, unul dintre cele mai populare podcasturi de azi. A produs pentru This American Life și a scris pentru The New York Times, New York Times Magazine și Capital New York. E unul dintre inovatorii formei: a spus povești pe tocătoare de lemn, în benzi desenate și pe post-ituri animate.

Dragoș Bucurenci Dragoș e trainer de comunicare, cu peste 1.000 de manageri instruiți în public speaking și storytelling. A construit ONGurile Salvați Dunărea și Delta și MaiMultVerde, a scris pentru ziare și reviste, a produs și prezentat emisiuni TV. După un MBA la Stanford, a fost consilierul de comunicare al Comisarului European pentru Politici Regionale.

Partener Silver


Test your abilities

programez.ro

Coming soon


sponsors

powered by


Issuu converts static files into: digital portfolios, online yearbooks, online catalogs, digital photo albums and more. Sign up and create your flipbook.