Blog

10 Steps to Continuous Delivery

/ Olivier Dugas
It's been 18 years since Joel Spolsky's 12 steps to better code and since back then, technologies, tools and techniques have improved greatly. In this post, I want to share with you what I think is the checklist any software company should comply with nowadays. Do you version-control everything?...

Read More...

Even C Developpers Have Their xUnit

/ Olivier Dugas
While coaching a team on how to program in a TDD fashion in C, I stumbled across this wonderful testing and mocking framework. I often have to develop softwares in C++, so I was getting used to write tests using GoogleTest and GoogleMock. When I had to write code in C, it remained the way to go,...

Read More...

GoogleTest and GoogleMock CheatSheets

/ Olivier Dugas
I made a cheatsheet to help people get into GoogleMock, and I want to share it, along with the links and cues you need when you'll get started with GoogleTest. Here's the links to GoogleMock's CheatSheet and to GoogleTest's CheatSheet In order to use GoogleTest, have a look at the Advanced G...

Read More...

The challenges of Embedded Systems

/ Olivier Dugas
I gave a seminar in French at Laval University, which will give rise to a 2 days course that I will start giving in Montreal in 2016. This post offers a download link. During this seminar, I discussed with the attendees about: Embedded Systems The different kinds of embedded systems The diffe...

Read More...

Use The Builder Pattern For Clean Tests

/ Olivier Dugas
The vast majority of the unit tests we write mandates an initial context. This post is all about cleaning this initial part so the tests read like well written proses that go straight to the points. I give all the credits of this post to Elapse Technologies as this is a quick reference to one of...

Read More...

Unit testing an abstract class?

/ Olivier Dugas
Don't laugh! That may sound curious (or trivial, if you are a true tester), but why would you repeat the tests for the methods of an abstract class into all of its children? Or worst, why would you write the tests for the methods of an abstract class in only one child? That would not be unit tests...

Read More...

Mocking Internal Objects in a Clean Way

/ Olivier Dugas
Suppose you have a class with a public constructor. This class contains a private object that do a lot of stuff you don't want it to do for unit testing. Here's an excellent way to do that. Imagine you have a User class that contains a class for authentication: public class User { private St...

Read More...

Static (or Shared) Classes And Methods: A Rule Of Thumb

/ Olivier Dugas
Have you ever seen or written static methods in your company's project? I'm sure that some of you did, because I often fell into static classes when I dug into most of the entreprises' code I visited. The question is: Do you think it's a good practice? Just to make things clear before I start writ...

Read More...

Extended Kalman Filter with Quaternions for attitude estimation

/ Olivier Dugas
During my Master's degree, I found a complete tutorial for the quaternion algebra. The authors explained the process of implementing a Kalman filter for attitude estimation with 6 degrees of freedom. In this post, I show an implementation in Matlab. I've also made a Python version of the code, so wr...

Read More...

6DoF Cooperative Localization for Mutually Observing Robots

/ Olivier Dugas
I'm the first author of this paper, which was accepted to the International Symposium on Robotics Research of 2013. In this post, I present the abstract of the paper and I offer a download link. Here's the abstract: The solution of cooperative localization is of particular importance to teams of...

Read More...

The Cubic Sudoku Problem

/ Olivier Dugas
On my previous post on this subject, I explained how I created a Sudoku solver for Android using the CoR pattern. Now, some students I am supervising in an engineering course at Laval University were given the task to solve a Cubic Sudoku. This problem looked interesting so I wanted to search a bi...

Read More...

Chain Of Responsibility Sudoku Solver for Android

/ Olivier Dugas
A couple of years ago, I implemented with the help of Julien Grenier a little program for creating random sudokus and for solving them in an intelligent way. We demonstrated that there was a simple way to solve a Sudoku faster by avoiding the bruteforce solution. Since it worked well, I took a day...

Read More...

Things To Avoid When Using Design Patterns

/ Olivier Dugas
While doing a code reviews in a class of studients at Laval University, I heard that some people think that design quality is a very subjective matter. As long as they were using design patterns, the code they developped was clean. In this post, I will explain that everyone should be careful when us...

Read More...

Unit-testable version of the Singleton

/ Olivier Dugas
One of my friends, Jean-Nicolas Viens (JNI) found this tweaked version of the singleton pattern. It make possible to inject mocks, so unit tests are still possible! public class RepositoryLocator { private static RepositoryLocator instance; public static RepositoryLocator getInstance() {...

Read More...

The S.O.L.I.D. principles of Uncle Bob

/ Olivier Dugas
This small post is about the SOLID principles. They have been described in the books of Uncle Bob and in his blog, which I invite you to follow cleancoders.com. But as I know them, I wanted to put them in my blog. SOLID is an acronym of their combined names : SRP: Single Responsibility Princip...

Read More...

Testing MapReduce with MRUnit

/ Olivier Dugas
I've recently started a big data project with Mathieu Dumoulin. We are using Mahout with Hadoop to do some machine learning with some Map Reduce in order to deal with big data the right way. We've found the way to test our Map Reduce code, so that's what I present in this post. Long story short, w...

Read More...

MapReduce File Manipulation Using Pig Scripts

/ Olivier Dugas
In this article, I will present you Pig, a scripting language that is used with Hadoop. I had to learn Pig for a project I worked on with Mathieu Dumoulin. Pig is very similar to the SQL's syntax, but allows one to manipulate big data in mapreduce mode quite easily. First, you can find good tutori...

Read More...

Avoid The Unavoidable Visitor's Cycle Of Dependencies

/ Olivier Dugas
I got a quick tip. I had to implement a visitor pattern (as in GOF's book, "Design Patterns", go read it). After it was done, I suddenly realized that this class had created an enormous cycle of dependencies in my program. It is a problem inherent to the pattern when implemented in C++, C#, Java and...

Read More...