12/12/2018

The big testing guideline

Introduction
Based on my experiences for a lot a of people there’s a big chaos in their head about software testing, sometimes even for programmers and project managers. That’s why I decided to write a post which is giving a rough overview about the different ways of software testing.
As I started my carrier I was working for a small start-up. There software testing meant, that someone is starting the software, does some random clicks and checks if something strange happens or not. Later on I changed to automotive business. In this field testing is really strict. But all what I learnt: the software itself determines the right testing process. It is up to that: how safety critical is your software, who will use it, how complex is it etc.
There are several ways of testing, these methods can be either automated or manual, functional and non-functional, black box, grey box or white box  and it can be on several different levels (unit testing, component testing etc.). For each project you need to find the most fitting way of testing. Of course more methods you are using at testing there’s a lower chance to keep bug in the software (and this chance will never reach zero), on the other hand of course testing takes time, so it costs money as well. That’s why you need to find the most fitting way to your project. Now I will try to introduce you to the different ways of testing.

Functional and non-functional tests

Functional tests

A test can be either functional or non-functional. Functional test is usually against the functional requirements. Here you are basically checking if the functionality of your software is the same as the requested behaviour. You need always take care about corner cases as well.

Non-functional tests

Non-functional testing is going against the non-functional software requirements, it can go against the stability of the software, it can test if the software is running under each requested environment (operation system, web browser, different hardware etc.). Security test belongs to this category as well which is checking if your software is secure enough, it can be especially important in case of web based applications. Load test belongs here as well, which is testing how your software is reacting in case of large number of requests. Here you can test also the runtime of your software in the most critical scenarios (profiling) or the memory consumption. It can be also a usability test, where you are testing with the target users if your software is user friendly enough.

Automated and manual tests

Automated tests

Automated tests are normally so called “coded” tests. They are implemented once and can be run anytime later. Classical example is the unit testing of your code with some test frameworks (GTest, JUnit etc.). Other automated tests can be implemented with some testing frameworks (like Selenium) or with script languages (Python is also popular in this field). The common point here is that you are providing some inputs to your program, or to a piece of your program, then you are letting your program run and finally you are comparing the results with the so called expected results. The automated tests should be deterministic. That means with the same peace of code they should always pass or always fail. The big advantage of automated testing is that you can run such tests after each change of your code base and you can check if the changes were not breaking your already working functionality. For this reason you can integrate them to the continuous integration system, which is running your tests after each new commit once.
Automated tests can also be implemented parallel with your code, so you don’t need to wait with the test development for an already done software.

Manual tests

Manual tests are tests which can be done manually. So you are manually starting the program, doing some predefined steps and checking its behaviour. It is good to do such tests for functionality that you don’t want to test frequently or where it is difficult to test it in an automated way. What is important here: manual tests also needs to be done based on a test plan what is describing the different tests scenarios with exact test steps and expected behaviour.

Test categories based on knowledge about code

Black box test

In case of a black box test you have totally no knowledge about the code. You are just like a simple user, you are trying out the different functionality of the software, without considering its implementation details. For black box test is good to have a tester, who has really know knowledge about the implementation details of the software (so who didn’t take part in its development). Black box tests are usually done against the software requirements, which also needs to be well documented to be able to define good test cases. In case of a black box test you also need to think like a user. A black box test can be both automated or manual test.

White box test

In case of a white box test you have access to the whole code base and you are considering it at your test case definition as well. For example you know what are the exact parameters of your function and you know, that in case of a negative parameter value your function has to throw an exception then you should define such a test case. The most typical white box tests are unit tests, but you can do white box tests on different levels as well. It can be both automated and manual test. So that also counts as a white box test if you as the developer of your code you are trying out with a debugger how your code is behaving in case of specific inputs. One important counter at white box testing is called code coverage: it means how big percet of the lines of your code are really running when you are running all your tests.

Grey box test

In case of grey test you have limited knowledge about the code. For example you know what are the components, which interfaces are used, what are the parameters of the interfaces, but you have no idea about that how the component is implemented.

Levels of testing

There are different levels of testing from testing a small piece of code to testing the whole system. Each levels has their own advantages and disadvantages. Normally the advantage of lower level tests is that they can run faster and can show the root cause of the bug more precisely. On the other hand there are bugs which can be detected only by higher level tests, because they are caused by the wrong cooperation of different software components. But in case of higher level tests it is difficult to tell at a failing test case where is the root cause of the bug and normally they are running longer.

Unit test

Unit test is the lowest level of testing. Unit test is testing one unit. A unit should be small enough, most of the cases it is a function or a class. In case of unit testing you are really testing this small peace of code. To avoid to be influenced by other units other units can be mocked. That means you are changing them with code peaces with some fake/dummy behaviour. For such reason there are several mock frameworks, like Mockito or GMock. To be able to mock you need to have a clear and modulable code architecture. One common methodology to make mocking easy is called dependency injection.
A good unit test is small, fast, independent and testing one small piece of the code. Usually unit tests are automated but they can also be manual.
One more important method is called Test based development, where you are basically implementing your unit test cases parallel with your code.
Unit testing is usually done by the developer of the code. On long term it is useful to find regressions.
A good unit test is showing the exact place of the bug in case of failure, so that no long debugging is needed to fix your code.

Component test

Component test is about testing a component of your code. If your code is modular enough and it is organised into components with clear interfaces you can test these interfaces separately as well. This is a good candidate for grey box test. So you know what are the interfaces to be used (for example in case of a library) and you know what you are expecting from these interfaces, but you don’t know what is their exact implementation.

Integration test

Integration test are for testing how several components are working together with each other. Integration test can also detect bugs which are cause by the incorrect cooperation/connection of the components.

System test

System test is going against your whole system, so you software running on its target hardware in its target environment. These test are usually done as final tests, before the publication of the software. These should be done at each software release. This is usually a black box test, can be both manual or automated. This level of testing is usually done by an independent test team.

Who should test?

Regarding the question who should do the tests there are several different opinion. In case of classical testing approaches the rule is usually that the tester and the developer should be two different person. So if the developer was thinking in a wrong way or had a wrong understanding of the functionality the tester could still find the bugs. I think this is a good approach in case of higher level tests and usually in case of black box tests.
In case of modern testing approaches like test based development the tester and the developer is often the same person. This is passing well to the agile approach where all team member should be able to take over any kind of tasks (testing, development, design etc.). This approach is making the testing a bit faster, but based on my experiences it is also not so effective.
I think the most safe way is the aggregation of the two way: implementation of unit tests by the developer and testing on higher level with black box tests by an independent team. But in case of all development it needs to be considered if it worth to take so much time for testing. In case of safety critical system like automotive development of development of an airplane software of course it makes sense. But in case of a web page or a game mobile app maybe it is not so important.

Testing in project lifecycle

In the classical development methodologies like waterfall of V-Model tests are coming clearly after the implementation. But the development of automated tests can be also done parallel with the development. At the places where such classical methodologies are followed the software is also done in a cyclic way. That means there are regular software releases and each released software should be tested. So until the development team is working on release N+1 the test team is testing the release N and is preparing automated tests for release N+1.
At agile development methodologies, like SCRUM or Kanban, test driven development is often followed. That means the unit tests and the implementation are being done parallel. What is important, that in case of agile development you can also do some higher level tests. You can handle it as a separate user story to implement such tests. Or it can also be that there’s a separate test team which is also working for example based on scrum and they are always testing the results of the development team some sprints later.
In case of both classical and agile approaches I think it is really important to integrate the automated tests into the CI system, so it is able to check regularly if the software is working properly. Of course in this case the tests needs to be also updated regularly up to the newly implemented requirements. Since to run all tests can take long it is good to setup your CI separately for the different levels of testing. Like run all unit tests in case of any new commit, run all component and integration tests every night and run all the tests at each software release.

Summary


I just realised during the writing that it is really a complex topic, so I think I couldn’t introduce everything detailed enough, but I hope I could give you a good overview. Since testing is done with different approaches and in different ways at different companies I’m almost sure that experienced tester would disagree with some of my points. It can happen, I’m also not a tester to be honest. I hope my article could help you.

12/07/2018

Being a father and a programmer in the same time

Before I became a father I had totally different priorities in my life, but at that point everything changed. I needed to find a balance in my life between my new and old responsibilities. I wanted to be a good father, a good husband and a good programmer at the same time. In fact it is not easy at all. I can imagine only one situation which could be even more difficult: being a mother and a programmer in the same time. But luckily I will never experience that. Of course it is the some for every father, also difficult for non-programmers, but in this post I would like to concentrate on the point which are specific for programmers. So this is a non-technical post for programmers.

Let’s see the facts. One hand if you want to be a good husband and father you need to be at home in time, to be able take as much time as possible with your family. And during this you shouldn’t be too tired or stressed, you need to be mentally there and remember on things which are not in your calendar, not pushed to a version control system and are not documented at all, that’s challenging.
On the other hand you need to take care about the financial needs of the family. So unfortunately skip work is not really an option.

To be able to achieve it at your work you need to be mental fit as well, you need to be available in case of stressful project situation and make sometimes over hours as well.

So to summarize, you will have two responsibilities: at the first one everything is deterministic, documented and you have long years experience with that, at the second one everything is totally random, undocumented and you have no idea how to do it. One thing is common: both of them means a lot of work and needs a lot of time to fulfill all the expectations.

What advantages do programmers have compared to other professionalities:

  • Opportunity for home office: always more and more companies are providing such an option at least 1-2 days per week. I really suggest you to choose such an employer
  • Flexible working hours: programming is normally not a job what you doing from 8 to 4. You have here a flexibility and a chance to find the most convenient time for work. Do it, find the most fitting one. I personally always try to arrive early and leave early to have more time after work.
  • Good salary: I think this point doesn’t need more explanation, but it is really important if you have a family
Of course there are several disadvantages as well, but think in a positive way and call them rather challenges:

  • Critical situations in your projects where over hours are requested: at most of the companies there are sometimes critical project period, when everything is burning and you need to work really a lot to achieve your goals. And of course it is very difficult to let the family understand such situations. Here you need to do some self control as well: do over hours only if they are really needed, but avoid them in all other cases. You can use some hybrid solutions as well: do extra work at night when the family is sleeping.
  • It is a mental challenge: programming is a mental challenge, I mean I’m quite often thinking about the solution of my current tasks even out of work: at home, during travelling etc. Based on my experiences it is really difficult to take care about a child while you are just figuring out the best algorithm for your current problem. You need to stop thinking about such topics when you are with your family, even if it is difficult. And during this time you need to load some other memory areas where you are storing info like, what should your child eat, what time do you have an appointment at the child doctor or where are the clothes of your child stored. For me it is more challenging then solving any of my daily programming tasks…
  • You need to develop yourself: for most of the programmers programming related activities are not limited to the workplace: you are doing home projects, learning new technologies at home, reading technical articles and forums, checking for new work opportunities or writing blog posts. These are things which can make your carrier and salary up, but if you have a family it is difficult to find time for such activities.
Finally I just collected my suggestions to find your work-life balance:
  • Family should be always prioritized over project and work: you can always find a new job or new project if things are going wrong, but it is almost impossible to find a new family.
  • Don’t do too many over hours: too many over hours just destroying your balance
  • You need to know how to say no: Sometimes you need to say no even for good opportunities if it is not fitting into your time. Never mind, an other one will come later.
  • It is never too early to start to teach programming to your children!
Let me share thought: always think about that what you wanna remember in 40-50 years: on the time you spent with your family or on the project which you were working on and set up your priorities based on that!

So all things considered it is not easy at all to do these two things well in the same time but is is quite challenging, good luck on that!

12/04/2018

How to write a bug report?

This one is not a real blog post, just something short what came into my mind and what I wanted to share with you.

Unfortunately I have really bad experience with the bug reports I'm receiving. I often receive things like this:

  • "The software is not working" => OK nice, what does it mean not working? Did you forget to start it?
  • "I can not click on the button" => Your mouse is not working or what?
  • "It is not saving the file"
In case of such bug reports it can take hours to figure out what you really meant and to reproduce it. So it is just a waste of time and you also need to wait longer for your bug fix.
Instead of that please try to specify all details regarding how to reproduce your bug and why is its behavior not normal?

A bug report should always contain the following information:
  • Which working environment do you have (hardware, which operation system, other relevant software (ex. browser in case of web application)) etc.
  • Which configuration/settings of the software are you using?
  • What are the steps to reproduce the issue (really from starting the software, please)?
  • What is the behavior you would expect here?
  • What is the current behavior (which is of course not the same as the expected one, that's why it's called bug)?
If you are reporting your bugs in such a way the developer who will work on that will be happier and your bug will be fixed faster!

Thanks!

11/29/2018

10 points for better software quality

Introduction

As bigger a project is, there’s more chance for quality issues. What can be these quality issues: too many bugs, too long runtime, too high memory usage, difficult to understand/difficult to modify coding style etc. These quality issues are making normally the user of your program unhappy, and the development slower. Unfortunately you can never rid of all quality issues, but you can avoid most of them by follow the points below. Of course these solutions costs a lot of time, but it is better to do this kind of effort in time and not loosing the same time with bug fixing.

1. Analysis of requirements

Before the start of development you need to make sure, that it is 100% clear what your program should do. Here of course you need to think about things like compatibility of the requirements with each other or if it is possible to implement all the requirements, are there any certain hardware limitations?
To be honest most of the bugs are coming from simple misunderstandings: the customer had a different understanding about the functionality as the developer.
That’s why it is good to document these requirements in a clearly written form and let the customer read them and accept them.

2. Software design

If the requirements are clear still don’t start with the coding. First think about the solution, about how it should be implemented? Which algorithms needs to be used? Which part of the code will be reusable? Which libraries could be used? How will the different components and classes communicate with each other? And so on…

With this kind of planning you can already find and avoid a lot of possible problems in the future. Document your design in form of text and/or UML diagrams.

3. Coding guideline
If multiple developers are working on the same code always have a coding guideline which defines the coding style to be used (naming of functions and variables, usage of brackets etc.). So that your code will have a uni formic style which is well-readable.

4. Regular reviews

Do design and code reviews with other team members. They can find easily the mistakes in your way of thinking or in your code code. Don’t let any piece of code be merged without a review on that.

5. Static code analysis

Use static code analyser tools. These tools are analysing your source code without running it. They can find a lot a of possible problems, like uninitialised variables, never satisfied conditions, unreachable code part and so on. They can check for coding style as well.

6. Unit tests

Implements unit test for you code. A good unit test is running fast and testing a small piece (unit) of your code. Unit tests can help to be sure in case of every change that you didn’t brake the already working functionality and they can help to understand for other programmers what your code is for, since from the unit tests they can see what is the expected behaviour.

7. Component and system tests

Don’t forget to do some higher level tests and the you component or system as it is. This is basically a black box test, so you are not doing it based on the code, but based on the requirements. You can easily check if your component is fulfilling the requirements or not. Think always about corner cases as well. These tests can be manual of automatised as well. Automatised tests have the advantage, that you can run the tests later any time.

8. Continuous integration

Setup a continuous integration server with a CI system (like Jenkins), let it to run nightly builds and check your code in case of each new change. You can integrate the static analyser and the automatised tests as well. So that after each commit you have an automated feedback if your software is working fine or not.

9. Bug tracking

Track you already found bugs in a bug tracker system (ex.: Mantis). For each bug document how to reproduce them and how it is differing from the expected behaviour. If one bug got fix you can shortly document the way of solution of the fix as well, to avoid the same kind of bugs in the future. With this method you will never forget about any bug.

10. Profiling and memory usage


To be able to maintain the performance of your software you need to measure it’s runtime regularly. For that you can any profiling tool. With this method you can also discover the part which are using the most runtime. You need to check the memory usage of your tool also. For such purposes always try to define the scenarios which are the most difficult one from computation point of view.

11/22/2018

How to prepare yourself for an interview as a software developer?


Introduction

Attending a job interview is really not easy and it can be quite stressful, but that’s almost the only way to get your dream job if you don’t have a good network. Your performance at a job interview can decide if you are getting the new job or not, you need to be fit from technical point of view and you need to pay attention on your way of communication as well. With a short preparation you can make your chances much higher. All the next points are based on my own experiences. I attended many interviews from both sides: as an interviewer and as a candidate. In this article I’m trying to summarise my experiences.

The application process is different at every company, but it’s a good idea to figure out what is waiting for you. The interview can be just a short introduction focusing on that what you are searching for. It can be an interview where they are focusing on your personality. Or it can be a technical interview. And it can be any combination of these three. So if you are getting an invitation for an interview and based on the invitation it is still not clear what will be the topic of the interview feel free to ask. You should clarify the language of the interview as well.

How to prepare yourself for the different type of interviews?

If it is an interview an HR partner most likely it will focus on that what you are searching for and on your personality. In this case you should not expect deep technical questions. Most likely you will go through your CV and you need to talk about your experiences. So before attending an interview always read through your own CV and try to introduce all your previous workplaces for yourself, focus on that what you were really doing there, which projects were you supporting, which technologies did you use, which responsibilities did you have. You should talk ca. 2 minutes about each previous position. There can be questions regarding studies as well, then you need to tell what were your studies, what was the main focus, what was the topic of your thesis. One more important thing: for sure you will be asked for what you are really looking for. For this question you need to have a clear answer. Like “I’m looking for a C++ developer position, where I can deal with software architecture as well”. Next to that there are some typical HR questions. To be honest for me it was always the most difficult part for me. Because I have no problem with talking about technical topics, but answering questions like: why are you better than the other candidate, or what is your strength and weakness is really difficult for me. So I would suggest you to collect the possible HR questions (you can find a lot of collection of them online, with some ideas what to answer), make a list from them and write down your answers. So that on the interview you won’t need time to think about.
At most of the companies there is a technical interview as well. But some companies are merging the HR and the technical interviews. As preparation for the technical interview read again the job description, which you applied for and the main technical skills in your CV. Of course you can not learn everything in some days, but it’s helping a lot if you are checking these topics before the interview. For all technical topics there are some popular interview questions. Like if you applied for a C++ developer job I’m almost sure that there will be questions about smart pointers and about multithreading. At the preparation try to focus on these topics. For all technical topics you can find interview question collections online, read them through and try to answer, if you can’t answer google it. If you are still not feeling comfortable enough my suggestion is the following: apply for jobs which has a similar description, but you are not really interested in the company (it is too far from your place, you heard a bad feedback etc.). So if you wanna have a job as a java developer apply for some java developer position even if they are not so interesting for you. Then you can take part on some interviews, where you have absolutely no risk, so you can try out yourself without stress and you can figure out what are the typical questions in that field.
Before the interview always try to find some information about the activities of the company. It can help a lot if you are thinking a bit before what can be their technical challenges or which technologies are they using.

How to behave during the interview?

During the interview stay calm and confident. The interviewer may try to make you feeling uncomfortable, but try to stay calm. Typical questions for making your feeling uncomfortable are questions like “Why would you like to change your job?”, “Why are you better than the other candidates?”, “How is your connection with your current boss and colleagues?”. It is good if you are preparing some answers for these question before the interview. They should be honest, but political correct. So it is not a good idea to answer: “I hate my boss, because he’s a shitface.”, better to tell: “Sometimes it is a bit difficult for me to ensure my boss about my ideas.”.
If you are already at the interview try to give always your best answer, stay calm and confident. But one important thing: don’t be shy to give the following answer: sorry, I don’t know, I have no experience with that. So you can save a lot of time for the interviewer and some uncomfortable minutes for yourself. At most of the interviews it is not a problem if you don’t know everything, but that’s a problem if you are telling something what is totally not true. It happened thousand times with me as well. When I’m leading the interviews and asking the candidate: “do you have experience with QT Signal-Slot model?” I’m usually get the answer: yes. And then for the question: “How does it work?” I don’t get a clear answer, just some bullshit. So that’s something to avoid, it is much better to tell: “No, sorry”, then no problem, let’s talk about some other topic.
There’s one more thing: a job interview is like dating: both sides try to make sure that you are matching together. So you need to show your best side: mention everything what you can do, but don’t lie, they will realise and you can get some really uncomfortable situations. On the other hand you need to check if the company is fitting to your needs or not. At the first part of the interview let the interviewer ask, but after that normally the interviewer asks you if you have any other questions. Yes, you should have! Ask about the position, ask about the company, ask about the used technologies. So that you can have a clear picture about the opportunity and you can decide if you wanna join them at all. On the other hand it makes a better feeling to the interviewer as well, it makes the feeling that you have real interest in the position.
On the day of the interview don’t make any stress anymore. Fine some matching clothes. At this point you should follow the dress code of the company. Check their website before and if they have pictures check what their employees wear at work. The most important: go there in time. It is better to plan your arrival 20-30 minutes earlier than the start of your interview. A lot of thing can happen: no parking slot in the near, traffic jam, your train is late, you can’t find the address etc. But if you are arriving too early don’t enter the building. Use this time to walk around the building and check everything what can be interested: where are parking slots, is the a place where you could eat etc. Enter the building around 10 minutes before the start of your interview. Go to the reception introduce yourself and tell that you came for an interview. Never forget the name of your interviewer (if it was in the invitation). At the beginning of the interview most of the cases you will be asked if you need water. It is good to say yes. You can always win some really useful second during the interview by drinking some water. In the meanwhile you can think about the answer. Regarding winning time: if you know the answer but you need to think some seconds you can start to bullshit. OK, this is maybe not the most correct word, but what I mean here is sentences like: “Yes, I had to solve such a problem at my previous project, it was quite complicated to find the solution…” and the you have some seconds in the meanwhile to formulate your answer. Or just one more example: the question is how locks are working in multithreading. Then you start with that what is locking and why is it necessary at all and at the end you can tell how it is working, but then you had some time during your introduction to formulate your answer.
And last but not least: at an interview your technical knowledge is not the only thing what is checked, your attitude, your personality and your way of communication is very important as well! Be honest, open-minded, look motivated, that a half success.

The big question regarding salary

One of the most interesting part of the interviews is the salary. Usually this topic is coming up only at the end of the interview. Let the interviewer come up with the topic. If the topic is not coming up don’t worry, maybe it will only come up on the next round interview. Regarding the answer: If I’m searching for something new I’m always deciding first what is the minimum salary I can accept. When I’m asked about my salary needs I’m usually telling 10-20% more than this amount, but I’m mentioning that I’m flexible. So if the company can pay my wish for the position I will be more than my minimum expectation, if not there’s still space for some further discussions. For me this strategy worked well. If you have no idea about what would be realistic use google: there are several pages which can tell you what is the average salary for a specific role in your city!

Summary


These were my tips for this topic, I hope I could help you, feel free to extend it if you have more ideas. So prepare yourself for the typical questions, know what you want, be honest and do your best! I wish you a good luck at job search!

11/15/2018

Most important points of good software architecture

Software architecture is really similar in my view as architecture of buildings. You can build a small house without a well-planned architecture, but it will never be perfect. And you can not build a big building without good plans. During the planning phase you need to take care about several thinks: choose the correct walls, plan the electricity, water-system, all rooms, light system, air-conditioning and heating and a lot more. So this is a complex, difficult but necessary job.

It is the same at software architecture: you can implement small programs without a proper architecture, but they will be never perfect and you won’t be able to build up and maintain a huge program, because it will become a big monster with a lot of unknown code part, unknown functionality and bugs. And after a while at fixing each bug you are covering five other bugs. But of course it is not easy to plan the correct software architecture, you need to think about several points: main functionality, hardware requirements (memory usage etc.), define the main components, reusability of the code, stability, timing, internal communication, compatibity, extensionability, configrability etc. etc. etc.

And what are you doing in fact when you are planning your software architecture: based on the requirements you are splitting the whole software into components and subcomponents, planning their responsibilities and interfaces and planning the way of communication between the components.

There is one more big difference between the architectural plan of a building and software architecture: since the building and not changing frequently the software is changing: the requirements are changing often and new functionality is coming. So you need to plan your software in a way that it is possible to extend it without big changes. For that you need to find a really modular architecture.

I have one more favourite explanation of good software architecture: a nice modular software architecture is just like a furniture in IKEA (no, it is not an advertisement here). That furnitures are built up from really simple modules (modular built-up and components with single responsibility), which are connecting to each other at some predefined connection points (clear interfaces) and they are documented in a pretty easy and pretty clear way (well documented usage). Furthermore there are several variant of each furniture, you can choose between glass door and wooden door, 3 or 4 chest versions, add a lot of extensions like extra lights or a mirror inside. So it is open for extensions and it is configurable. So my goal at desigin a software is always a similar result.

Here I just tried to collect the most important points of good software architectures.


  1. Modularity

Your software needs to be built up from well-defined modules/components. If your component is still to big you can split it into so-called subcomponents. In case of a complex software you can use multiple level of subcomponents. As you are using this strategy you will have a lot of reusable components.


  1. Clear responsibility for the components

Each of your components needs to have a clear responsibility. It is good is you can describe its responsibility with one sentence. If you can not describe it without using the words “or” and “and” then your component is too big as it should be splitted. Good examples for the responsibilities: “This component is responsible for the storage of user data.” . But even inside this component some subcomponents can be introduced, like a component responsible for the connection with the database.


  1. Clear interfaces

The defined components needs to communicate with each other through clear interfaces. Each interface has a name, a return type (it can be void as well), and optionally some parameters. That a good practise to make a difference between private and public interfaces. Private interface is available only inside the same component, public interfaces are available for the other components as well. The number of public interfaces should be as limited as possible. Each public interface needs to be well-documented. On long term you should avoid to change or remove already existing interfaces.


  1. Documented behaviour

Your component will be used by other components and so maybe by other programmers. So it should be documented in a very clear way what are the components doing and what is the expected behaviour of their interfaces. You can change the internal behaviour of your component any time (how is it doing), but avoid to change the external behaviour (what is is doing). For this purpose you can use UML diagrams.


  1. Easy to understand

I have seen several times architectural designs with very long chain of derivation and complicated connection between components. In the end they were working perfectly, but no one understood why and how to use them. You should avoid such solutions. Since your component will most likely be used by other developers it should be easy to understand its behaviour.


  1. Configrability
    Your component should be well configurable to be able to use it in multiple environments. My strategy for making my code configurable is the following: everything what would be a magic constant in the code (path, magic string, magic numbers etc.) should be moved to a configuration class which is storing all such information. And then this information should be able to be modified from outside through a config file.


    1. Layered-architecture

    In case of a complex software not all components should communicate with all the others directly. You can introduce some additional restrictions, like layers. You should organise your components into layers and only the once can directly communicate with each other which are either in the same layer or in the neighbour layer. A good example is the so called MVP (Model-View-Presenter) architecture which is often used for GUI applications. The view can not communicate directly with the model, but the presenter can communicate with both of them. With this solution your way of communication will be much more clear and you can change your components much easier.

    1. Clear communication sequence

    It should be defined in a clear way how your components are communicating with each other. How is the information flowing between them. Which one is calling which one. For the purpose you can use a UML sequence diagram.


    1. Well-designed error handling

    The error handling of your whole software should be handled based on a common concept. There are several solutions: using special return values, exceptions or error flags, but what is important, that you need to use the same solution in all of your components. That makes it easier to understand your whole system.


    These 9 points are not covering everything, software architecture is a much more complex topic. But if you are taking care about these 9 points at planning your software you will already reach a good software architecture.

    11/10/2018

    That’s how you recruit - The most annoying recruiting methods

    As a programmer I’m active on several professional portals like LinkedIn and I’m getting in touch with several recruiters every week. Most of them are really nice, but unfortunately during the years and especially during the last months I collected a lot of bad experience with them. Sometimes I’m finding myself in strange situations, which I have never expected. When I was in such a situation quite often I couldn’t find the optimal solution, but later on I was thinking about how should the situation have been solved and found some good ideas. In this post I try to collect the most typical issues with recruiters and their possible solutions.


    “I have a great position as senior java developer” - Finding you with totally irrelevant positions

    At least once in a month I get some messages about senior java developer positions, however I’m not experienced with java and java is even not mentioned in my profile at all. To be honest I don’t understand why I'm getting these messages. Sometimes I'm clarifying the situatio in an answer, usually the reaction is “no problem, I’m sure I can find you something else”.
    So my suggestion in such cases is just send and answer containing the fact that you have nothing to do with that technology, maybe there are other opportunities as well.

    “Send me your number, I have a great opportunity, I will call you”


    I get often messages like “You have a good profile, send me your number, I will call you”. OK and now? I don’t wanna waste my time with talking about irrelevant opportunities. So usually I’m asking the recruiter to send me a description about the opportunities. Most of the cases I even don’t get an answer on that. If you have a lot of time, feel free to do these calls, otherwise just ask for a description.

    “Please fill out these 10 page long document to be able to start with your process”

    A lot of head counters are asking you to fill their questioneries. Usually these documents are containing exactly the same information as my CV but in a different format. It takes quite long to fill them out. I don’t really see why they really need to have your CV in a new format. But here if you really would like to have a position you can not do anything else, than filling out the document.

    I have a position for you, but I don’t know anything about that

      I often receive messages like: “Hi, I have a great C# position, are interested?”. Come on, how could I decide based on that if it is interesting for me or not? So the simplest solution: ask for more details.
      My other usual issue in the same category is when I’m asking about the location of the office (since often the name of the company is not public). Since I don’t wanna move to a new flat for me it is important to find a workplace which is not too far from my place. And in case of bigger cities it really makes a difference if the office is in the next streets or in the other side of the city and it takes one and a half hour to get there. I'm usually asking for the location of the office. Most of the cases the recruiter has even no idea about that and it is sad. Here the only thing what you can do is to wait until the first personal interview, there you will know the location of the office.

      “Are you interested?” OK, then I disappear now



      Sometimes I’m just getting messages like “I have a position which would fit to your profile, would you have interest?” And if my answer is “yes” I'm never hearing again about them. It is strange, I never understood. But if you really have interest in the position you can try to apply at the company directly (without the support of a headhunter).

      “Are you interested in this position? No problem, I have 5 similar opportuities”

      This is the most annoying one. It happened with me multiple times: I’m applying for a position which would fit really good to me. In some days I will be called, but at this time it is not going about the position which I was applying for, but about similar positions which are anyway always less fitting for me. I have sometimes the feeling that these positions are not existing at all, they are there only for Marketing purposes. Because if you are getting already in touch with the recruiter most likely you will check he’s other opportunities as well. In this case you can not do a lot, just decide if the other (offered) positions are interesting for you or not.

      “What is your current salary?”

      I have been asked by recruiters often about how much I’m currently earning. I think this is a private info and anyways it shouldn’t influence my situation. So my suggestion is: never tell your current salary, it is a secret info, but tell the salary what you would like to have. I think in this ways it will be most more fair and clear.

      The strangest interviews

      There are several different kind of interviews. I think the strangest ones are the ones with the HR about questions like “what are your strength?” “How can you imagine yourself in 10 year?” etc.
      The strange one was when I got a complicated problem to be solved during the interview. What ever I tried to explain about my solution idea I got the feedback: “Yes it would may work, but this is not the solution I would prefer. Come on? If my solution is working as well, why should I stick to his solution? I didn’t get an offer, but to be honest I didn’t mind.
      With such “strange interviews” I think you can not do anything. But what is important in my view: an interview is not just about the introduction of the candidate, but about the introduction of the company as well. If the interview is strange, then there’s a high chance that the company is strange as well.

      “Would you like to move to the end of the world for a 6 months project? You should start tomorrow”

        I’m getting such messages every week. And I really don’t understand who would overtake a fixed-term project for some months long long kilometres away from his home in the middle of nowhere. The costs of moving and staying there does not worth, even if the salary is good. Regarding start ASAP: I think the good developers are usually not free and they can start earliest in some month, but for sure there are exceptions.

        Never ending interview processes

        The interview process at some companies are really chaotic. You are having 3-4 rounds of interviews and that’s why the whole process takes 2-3 months long. Is it really neccesary? I think after one, maximum two round a decision can be taken. Otherwise there’s the risk that the candidate joins to an other company. And of course it is really frustrating for the candidate as well: somehow you need to get free from your work for each and every interview. Normally you don’t wanna tell that you are having a job interview, so you need to lie something. It is really inconvinient. And them do it 3-4 for times for each company you applied too. Really crazy.

          So this was short collection about the things what are annoying the most connecting to topic recruitment. I hope it would be good for all the developers, but also for the companies if these point would be avoided in the future. If you have any points to extend don’t forget to do it.

          How I prepared my first online course

          Since long I didn't publish anything here. It's because I was busy with some other topics, but now it's time to share the result...