Posts about technology and arts.

Ranges in Apache Commons Functor

This is a long post. So here is a TL;DR:

  • Apache Commons Functor has no Double or Float Range (yet)
  • Apache Commons Functor IntegerRange and LongRange treat the low value as inclusive, and the high value as exclusive. How does that compare to other languages/APIs? (you will have to read to see some comparison)
  • Perl has support for characters ranges, perhaps we could implement it in Functor too?
  • In case we implemented a CharacterRange, it would have to be inclusive for both low and high limits. With 'z' being the last character, there wouldn't have a way to include Z with the current approach. Or we would have to make the CharacterRange a special one. What would go against Liskov Substitution Principle.
  • You can see a comparison table with Apache Commons Functor, other Java API's and other programming languages for ranges clicking here.
  • It would be nice to have a clear distinction in Functor documentation among a Sequence, a Generator and a Range. While I was gathering material for this post, I found places using range, others using sequence, and in Apache Commons Functor, an IntegerRange is a Generator.

Now, if you have some spare time or curiosity, keep reading :-)

Testing shell code and producing TAP using Jenkins?

Definitely reading Hacker News before going to bed is a bad idea :-) Same goes for Reddit. So, I found a link about Bats, a tool to execute tests in Shell and output TAP - Test Anything Protocol. Then I thought; why not ask the author to include Bats under the list of Producers in

But you know what? Why not execute execute locally first to check if that’s working… moreover, why not use Jenkins TAP Plug-in and see what happens?

Listing of current projects, achievements and my New Year's resolutions

Tis’ the end of 2011! Yay! Throughout this year I’ve heard people repeatedly saying that I had too much on my plate, and that I should quit some projects, stop giving talks, start surfing again amongst other things. Now, looking back, although I’m quite happy with my achievements in 2011, I can see their point.

In 2010 I started working as Software Quality Engineer with Anderson Santos. He was the greatest supporter of many of my ideas, so although we stopped working together in 2011, I’m still grateful to him for all he taught, for his advices and for spending some time guiding me.

He motivated me to start giving talks, going to more conferences and contributing more actively to Open Source projects. Since then, I’ve given almost 10 talks, including one in Belgium Testing Days, another one in Oracle JavaOne and in March next year I will be in America for a talk in STPCON. I also missed JCertif conference in Congo due to visa problems and learned some lessons from it (so sorry Max :)

TDC 2011 Goiânia

Here are the slides used in TDC 2011 - Goiânia. The same slides were used in the Testing and in the Java tracks, though with different titles. The only difference is the demo, that had more details in the latter track.

tdc_2011_goiania_ci by brunodepaulak

This was the last talk of the year, I have two more articles to go (MundoJ and STP) and then it will be time to practice slackline, surfing and dedicate some time to my family.

Have a great Halloween :-) Cheers

Practical test doubles: adding stubs to TestLink Java API

"Test Double is a generic term for any case where you replace a production object for testing purposes" [1]. There are different types of Test Doubles: Dummy, Fake, Stubs, Spies and Mocks. In this post we will see a practical example of adding stubs to TestLink Java API.

Stubs are objects that return canned answers to calls during tests [1]. This is useful specially when you have a system that communicates with different resources such as databases, web services, XML-RPC services and so on.

TestLink Java API is a small Java project created to act as an interface between TestLink XML-RPC API and a client program written in Java.