Home » Author Archives: Peter Verhas (page 2)

Author Archives: Peter Verhas

Using junit for something else

junit-logo

junit != unit test Junit is the Java unit testing framework. We use it for unit testing usually, but many times we use it to execute integration tests as well. The major difference is that unit tests test individual units, while integration tests test how the different classes work together. This way integration tests cover longer execution chain. This means ...

Read More »

Default methods and multiple inheritance

java-logo

Recently Lukas JOOQ Eder posted and article about nested classes and their use. This is an interesting topic and his article is, as always, interesting and worth reading. There was only one slight statement I could not agree with and we had a brief reply chain leading to default method and why there can not be something like     ...

Read More »

Do not unit test bugs

java-logo

Before getting to the topic of the title let’s have a simple programming sample. On the programming task I will demonstrate some bad coding style and based on that it will be easier for me to explain why the same style is bad in unit tests. Well, now that I wrote this sentence this seems to be a obvious statement. ...

Read More »

Calling grandparent methods in Java: you can not

java-logo

In the article Fine points of protection I detailed how “protected” extends the “package private” access. There I wrote: What you can do is Override the method in the child class or call the parents method using the keyword super. And generally this is really all you can do with protected methods.   (Note that in this article I talk ...

Read More »

Fine points of protection

java-logo

In the article Some Sentences about Java I wrote that “Protected methods and fields can be used from classes in the same package (so far the same as package private) and in addition to that it can be used from other classes that extend the class containing the protected field or method.” Although the statement above is true it may ...

Read More »

Use copy paste programming!

software-development-2-logo

Copy paste is bad We hate copy paste. Why? Because the result code is unmaintainable. I get a bug reported from QA, I analyze the code, look at logs, debug, drink a lot of coffee and finally I get to the code that is the root cause of the bug. I fix it, test the use case, release new code ...

Read More »

Outsourcing, Do It Right

software-development-2-logo

Most of the times outsourcing is a nightmare. Companies outsource the activities that are not their core activity nevertheless needed for business to get the job done as cheap as possible. They look at it as some necessary evil, something that would better be not to know all about, forget the details and have it been done. Many times IT ...

Read More »

Why do we mock?

software-development-2-logo

I do Java interviews. During the interviews I ask technical question that I know the answer for. You may think this is boring. To be honest: sometimes it is. But sometimes it is interesting to learn what misconcepts there are. I happened to ask during the interview what you can read in the title: “Why do we mock?”. The answer ...

Read More »

Unit test life?

software-development-2-logo

You can not program without testing. You write unit tests first and then you write your code. (Well, I know you don’t but just let’s focus on best practice.) When there is an error in the code, first you write a new unit test that demonstrates the bug and then you fix it. After the unit test runs fine the ...

Read More »

Some Sentences about Java

java-logo

There is nothing new in this article. I just collected some trivial statements which may not be trivial for some of the junior programmers programmers. Boring old stuff. If you happen all of these things you know more about Java than the average house wife. I do not know if there is point to know all of these. You can ...

Read More »
Want to take your Java Skills to the next level?
Grab our programming books for FREE!
  • Save time by leveraging our field-tested solutions to common problems.
  • The books cover a wide range of topics, from JPA and JUnit, to JMeter and Android.
  • Each book comes as a standalone guide (with source code provided), so that you use it as reference.
Last Step ...

Where should we send the free eBooks?

Good Work!
To download the books, please verify your email address by following the instructions found on the email we just sent you.