Uncle Bob’s Video Presentations: TDD Part 2 and Being a Software Architect

It has been more than a month since our last post about the screenings of Uncle Bob’s video presentations (organized by the Łódź Java User Group) that we’ve been happily attending. During this time, we had the opportunity to watch two more episodes in the series.

The first of these episodes continued on the topic of Test-Driven Development (introduced in the previous episode) and Uncle Bob’s approach to it. He addressed a number of arguments against TDD – I won’t go into the details, let me just say that Uncle’s counter-arguments were very convincing. In addition to that, a complete example of a bowling game program written with TDD was presented (this example seems to be quite popular as a demonstration of TDD).

Our team is currently participating in one project that makes extensive use of TDD techniques. For me personally, watching Uncle Bob’s videos on this subject was a good learning experience. Of course, this won’t transform you into a TDD expert overnight – there’s a ton of things to learn about writing tests, and even more about writing good tests, but I’d definitely recommend the videos as a starting point.

The next episode in the series was devoted to the concept of software architecture, and the myths around it.

Uncle Bob presented his philosophy that software architecture is not about the selection of the right tools (e.g. an IDE), solutions (e.g. a specific DBMS), or technologies (e.g. an application framework). According to him, it’s all about the use cases (or, if you prefer, user stories) and having a good understanding of the purpose of the software that is being built.

Expanding on that idea, the source code of the software should clearly represent what it’s for. A programmer should be able to quickly identify that he’s looking at, e.g., a payroll application, rather than noticing that it uses the MVC pattern or is built upon a particular framework.

Uncle Bob believes that programmers and software architects should learn to decouple the layers of the system as much as possible, and be able to defer the decision of which framework/database to use until later in the project. The system ought to be designed in a way that allows for easy replacement of these components.

One point brought up in the video that I considered crucial was that software architects should also actually write program code. Understanding the business needs of a client is not enough to be able to design a robust software system. I think the most desired skill for a good software architect is the ability to work with both the business perspective and the technology perspective in mind.

To be honest, the overall ideology of software architecture presented by Uncle Bob seemed a bit demagogue-ish to me, but I guess that’s often the case with areas where business needs and technology overlap. If you are a programmer whose job is simply implementing parts of the system according to the provided specs, then the philosophical lecture on software architecture won’t be of much use to you, and you can probably skip this episode of the series.

Monthly Donations: Modernizr and the “Brave Mother” Foundation

We have managed to survive last month’s health crisis and are thus able to get to yet another round of our initiative of supporting open source projects and charities.

This month we are supporting Modernizr, a small library written in Javascript which detects native implementations of HTML5 and CSS3 features in web browsers. It allows us to benefit from newest technologies in our projects, while still being able to support older browsers by utilizing additional libraries and scripts that simulate new features for them.

The charity organization that we support this month is the “Brave Mother” Foundation, based in Jabłonna, a village just north of Warsaw. Since its founding three years ago, the Foundation focuses on helping mothers of children with disabilities. We wish the four founders further successes in their own struggles as well as in providing help for others in need.

Monthly Donations: GnuPG and the Animal Shelter in Łódź

It’s the middle of the month, and although half of our team is battling illness, this is not going to break our spirit and stop us from making our monthly donations to open source projects and charity organizations. This month the recipients have been carefully selected by Karol Pasternak.

We’re supporting GnuPG, the free implementation of the OpenPGP standard, which allows you to encrypt your e-mails in a fairly easy way (especially with the help of e-mail client extensions such as Enigmail). We often use it when communicating with more security-aware clients or when we need to send sensitive information by e-mail. Congratulations and thanks to the maintainers of GnuPG, g10code, and especially to Werner Koch, the original author of the program!

The charity organization that we’re donating to is the Animal Shelter in Łódź. We already supported them last year, but we know they are doing a great job helping animals and deserve more than just a one-time donation. We send our best wishes to all the people (and animals) of the shelter!

Uncle Bob vs. Mr. Spock – Video Presentation on Test-Driven Development

Not much time has passed since we blogged about attending a video presentation on clean code by Uncle Bob (Robert Martin), and we already had the pleasure of participating in another one in the series. This time the subject was Test-Driven Development (TDD).

After seeing the first video, I was already accustomed to the rather eccentric style of Uncle Bob and found his use of props and changing backgrounds entertaining rather than distracting. The new presentation had the form of a conversation between Uncle Bob and Mr. Spock, who is known for his purely logical worldview.

Uncle Bob explained how applying TDD improves the quality of source code, especially in large scale projects. He pointed out a common problem encountered by programmers working with complex systems, who are often afraid of making changes in existing (working) code, because it might cause unexpected problems. As a result, lower quality code is kept in the system.

Implementation of rigorous testing procedures mitigates these fears, since it allows the programmer who is making changes to the code to immediately run the tests and discover any problems. However, this only works when the programmer can fully trust the test suite. To make sure the tests are in fact trustworthy, the following three rules must be met:

  1. Any production code that is to be written must fix an existing, failing test.
  2. Every test must correspond to a specific missing feature or bug in the system, and must only check the minimal set of conditions sufficient for it to fail.
  3. It is forbidden to write more production code than is sufficient to make one failing test pass.

The advantages of the strict TDD approach are indisputable – in large projects, it allows programmers to work more effectively, it makes quality control much easier, and (as was already said) it eliminates the dangers of making changes in “old” code.

I won’t spoil the ending of the presentation and tell you whether Uncle Bob succeeded in convincing Mr. Spock of his perspective. He definitely did encourage me to try implementing TDD in a formal manner – I hope I will get a chance to do that in one of the projects that I’ll be working on in a near future.

Highcharts Legend Highlighter Plugin

We published a new project on our GitHub profile – a plugin for the Highcharts charting library, called Legend Highlighter, which adds the ability to highlight a specific data series on a chart.

The plugin was created as part of our work on a project that uses Highcharts, and it was initially supposed to only add a simple “slice out” effect for pie charts. We then extended it to support other chart types, making it more flexible and useful. We created a page with a few examples of how the plugin works with various charts (based on the demo charts provided by Highcharts) – go ahead and take a look.

The source code of the plugin is published under the MIT license, so feel free to use it any way you like, and fork it. We’re also looking forward to your feedback.

Monthly Donations: Nginx and the “KOTYlion” Foundation

Today is Sunday, so technically we’re enjoying the weekend, but since it’s also the 15th day of the month, we’re bound by tradition to do the monthly donations. This month, Krzysiek Skarbek had the honor of selecting the open source project and organization to support.

The first donation that we’re making this month is to Nginx, the BSD-licensed HTTP server which is famous for its scalability and performance. We appreciate Nginx’s qualities and often use it in our work with web projects, and have used it as a deployment server for a number of our client’s applications. We send our thanks and congratulations to the developers of Nginx, especially to Igor Sysoev, the original creator.

We are also supporting the KOTYlion” Foundation in Lodz, who helps abandoned and stray cats. We send our best wishes to the Foundation’s crew and volunteers, and of course to all of the cats under their care!