Today, I’d like to share with you the review of year 2017. Here’s the topics that I would like to talk about.
- Chrome extensions
- Hibernate Search: JSR-352 integration
- Test Driven Development (TDD)
- Code Quality and Sonar
- Oracle Java certifications
- Git Understanding
- Stack Overflow
- Improve Efficiency
- Reading Books
- action-news is an action extension to see yesterday’s news «20 Heures» on https://www.tf1.fr. Because the URL is written in French, and a sub-path of it varies between weekdays and weekends, so I wrote an extension to detect the URL correctly.
- action-nuxeo is an action extension to open all the important tabs for my daily work at Nuxeo in one click, including the Slack, GitHub, and Gmail. Therefore, I don’t need to open them one-by-one.
- action-stackoverflow is an action extension to open all the tag
combination that I’m interested on Stack Overflow. It helps to better filter
the questions where I can answer, so earning reputation is easier. For
example, the combination of (
The source code is available on GitHub: mincong-h/chrome-extensions
My Google Summer of Code project, Hibernate Search: JSR 352 Integration is finally merged into Hibernate Search, and released as part of Hibernate Search 5.9.0.Beta1. This integration provides an alternative to the existing mass indexer. Compared to the existing indexer, it is:
- Easy to understand, as workflow is described in XML.
- Free to choose your Java batch platform, e.g. JBeret, JBatch, or Sprint Batch (coming soon).
- Restartable from the last checkpoint.
The source code is available on GitHub: hibernate/hibernate-search
Test Driven Development
Test-driven development (TDD) is my favorite development process. I like writing short, comprehensive, and fast-to-execute unit tests during the development. It brings you full of confidence for no matter what changes you make. For all of my personal projects on GitHub, I linked them to Travis CI so that tests are executed at each commit-push.
As for software development at company, the process is harder. You need to convince your teammates for doing the same thing. And the process becomes unbelievably complex face to a legacy codebase. You need to know many things before going further. And my current techniques are:
- If task can be done in less then 30 min, don’t ask opinions, do it.
- Always look for quick win in tests.
- Use code analysis tools to drive your decision.
- Split long tests into small ones, with one objective per test.
- Prefer unit tests than integration tests.
- Use AssertJ which is more fluent then JUnit.
In 2017, I added two modules for testing in company, and improved the test coverage and tests’ quality.
Code Quality and Sonar
Code quality is very important for software development. After some discussion with my friends Kevin and Kevin :) , I decided to use Sonar to improve the code quality for both company’s projects (Nuxeo Studio, Nuxeo Connect) and my personal projects. For company projects, Sonar plugin is integrated with QA platform Jenkins, and is being triggered when commits get merged into master branch. Meanwhile, Sonar is integrated as a Maven profile, which can be used on-demand, and is excluded by default by other jobs, like release jobs. For personal projects, I used Travis CI instead of Jenkins. The integration is slightly easier, as documented by the official Travis CI blog post: Using SonarCloud with Travis CI.
- Company projects: SonarCloud + Jenkins
- Personal projects: SonarCloud + Travis CI
Since the Sonar integration, I felt that everybody in the team is more involved in the code quality process. By working together, we have already some improvements on different code-bases in regards to bugs, vulnerabilities, and code smells. In order to facilitate the usage, we also use SonarLint in both Eclipse version and IntelliJ version, so that we can see the Sonar issues inside the source code.
I passed the 1st level Java certification: Oracle Certified Associate, Java SE 8 Programmer in April 2017. It’s a great experience, and I really enjoyed the learning process: you need to learn Java in different aspects, such as data types, encapsulations, collections API, inheritance, exception handling. These are the must-have skills to be a Java developer.
Now, I’m going one step further—I’m preparing the 2nd level Java certification: Oracle Certified Professional, Java SE 8. It includes basic class design, advanced Java class design, generics and collections, lambda functional interfaces, stream API, exceptions and assertions, date/time API, file IO, file NIO, currency, JDBC, and localization. Edit: I passed this one on 13th January, 2018. Really happy that I passed, because it was a long preparation.
The source code is available on GitHub: mincong-h/oracle-certification
Git is a very important part of our daily development task. No matter you’re coding a new feature, fixing bugs, doing back-port, or releasing a new version, using Git correctly means you can better collaborate with your teammates in the Git manner. One year ago, I considered myself as a Git newbie, and I started reading the book «Git Pro». Now, when I looked back, the benefits are huge. Not only it helps me to understand what is Git, how to use it efficiently, it also teaches me how to think distributed data in the Git manner. «Git Pro» also provides an online edition for free, you might want to start from there.
I wrote 4 blog posts this year for Git:
And answered some questions on StackOverflow:
- JGit: read the content of a file at a commit in a branch
- JGit addFilePattern not working for my absolute path to a file
- How to obtain the RevCommit or ObjectId from a SHA1 ID string with JGit?
Thanks to all this basics Git understanding, The well-known performance bottleneck of Nuxeo Studio, the branch listing feature has been resolved, and the biggest project listing time reduced from 9,735ms → 126ms.
Why I don’t contribute to Stack Overflow anymore?
Using Stack Overflow was aimed to help others and improve my programming skills. This is a good initiative, but answering questions is not so obvious. In many times, it’s too difficult to provide an answer without digging deep into the context. Sometimes, question can be marked as duplicate, or can be answered in 5 min just after its creation. The post itself is not always well-explained.
Even though Stack Overflow is extremely useful in reader’s point of view, it’s not the best way for developer who want to learn by helping. Now, my preferred way to learn is to read books, read source codes, and code by myself.
At the beginning of the year, I was very frustrated by not being able to work as efficiently as my teammates. Then I tried different methods to make myself more productive. Here’re some techniques that I’d like to share with you.
- Use Pomodoro Technique to schedule your task
- Think twice, code once
- Make a mistake checklist
- Keep learning
- Automate repetitive tasks
I would say that the most benefit one for me is the pomodoro technique, which let me understand how many time I’ve, and how many time I’ve already spent on one task. And when should I ask others for help.
Reading books is my favorite way to learn software. Good books are very structured and easy to understand. Among the books read, I recommend you the following ones:
- The Pragmatic Programmer
- HTTP: The Definitive Guide
- OCA: Java SE 8 Programmer I Certification Guide
- OCP: Java SE 7 Programmer II Certification Guide
- Git Pro
«The Pragmatic Programmer» teaches a lot must-have skills of being a good programmer, including estimation, design, tooling, test, performance and more. No matter which programming languages you’re using, reading this book will let you become better in you profession. «HTTP: The Definitive Guide» is another very useful book. It talks about HTTP via real-world scenarios, including the HTTP message, web server, proxies, caching, authentication, HTTPS, internationalization and more. The two Java certification books, written by Mala Gupta, are must-read books for those who want to become a real Java professional. On one hand, these books are the best resources to help you pass your certifications, on the other hand, they give detailed and structured knowledge on every aspect of Java to let you benefit the advantage of each built-in Java API on your daily work. «Git Pro» let you understand how Git works and accelerate your Git experience. I used to make a lot of mistakes when using Git, but after reading this book, I use Git much better and start understanding the art of Git.
Goals of 2018
I’m still not sure about the goal of 2018 yet. I’ve already several ideas, but not sure which are realistic ones.
- Learn a new language, and understand the basics
- Contribute to Google Web Toolkit (GWT) project
- Contribute to AssertJ for JAX-RS integration
- Learn more about Git and JGit
- Learn more about HTTP
- Learn more about security
- Learn more about JAX-RS
- Learn more about design pattern
Let’s see what will happen at the end of 2018.