Xcode 3.2.3 , IOS4 and OCMock

To unit test our iPhone developments we rely heavily on Google-Toolbox-for-Mac and OCMock.
After updating to the iphone SDK4 (IOS4) and Xcode 3.2.3 we had an unpleasant surprise : our testing frameworks refused to compile and as of today we have no information about how to solve this situation.
Nevetheless we managed to resolve this problem :
(more…)

Classical issues: Imprecise computing (part 1)

I’m starting today a new series of articles called Classical Issues. In it, I’ll address, one after the other, classical issues encountered through my software engineering years.

This first article is targeted to demystify computing and give some best practices for an enterprise application. By enterprise application, we mean an application working on things like money, prices and quantities. It will be in two parts. This one is about explaining the root of the problem. The second one will show how to handle it in Java and .Net.

Bill is developing a software doing commission payments. He needs to add 1.2$ to each transaction. He codes a method doing just that and the unit test coming along.

 @Test
 public void testAddCommission() {
  double actual = addCommission(1000000.1);
  assertEquals(1000001.3, actual, 0);
 }

 public static double addCommission(double nominal) {
  return nominal + 1.2f;
 }

java.lang.AssertionError: expected:<1000001.3> but was:<1000001.3000000477>

“Darn! It’s not working!”.

What’s going on?
(more…)

A maintainable Flex architecture

With the Flex framework, we are able to quickly develop a GUI that works, especially through the MXML language. Indeed, this language is an effective way to describe the interface with a few lines of code.

The problem occurs after the POC step is done, MXML code complexity increases, ActionScript code which implements event handlers, services calls or business logic creeps slowly into the MXML code.
After some time, it becomes harder to figure out where data being displayed come from (ie. which code updated it ?), which code calls a service and from where the service arguments come from.

In this post, we will see some good practices which help in keeping a high level of maintainability for Flex applications.
(more…)