The Power of Quality: Why Your Software Needs More Than Just Correctness

When developing software, many people focus on one aspect above all others: functional correctness. While this is an important aspect of software development, it’s not the only one. Two other vital elements should be considered: software quality and software testing.

So what is the difference between software quality and testing, and why are they so important? Let’s take a closer look.

Software Quality

Software quality refers to the overall quality of a piece of software, considering factors such as reliability, maintainability, and usability. In other words, it’s about more than just whether the software works correctly or not. It’s about how easy it is to use, how easy it is to maintain and update, and how reliable it is over time.

High software quality requires careful planning and attention to detail throughout software development. It includes everything from writing clean, well-organized code to designing intuitive user interfaces to rigorously testing the software to ensure it meets all its requirements.

Software Testing

On the other hand, software testing is focused explicitly on verifying that the software works correctly and meets all its requirements. The process involves designing and executing test cases that exercise the software in various ways to ensure it behaves as expected.

While software testing is integral to software development, it’s important to remember that it’s just one part of the process. There needs to be more than testing to ensure high-quality software. You must take a holistic approach that includes careful planning, design, coding, and testing to achieve that.

Photo by Markus Spiske on Pexels.com

Why It Matters

So why is focusing on software quality rather than just functional correctness so important? The answer is simple: because software is rarely used in isolation. In most cases, it’s part of a more extensive system that includes other software components, hardware components, and human users. As a result, if the software is difficult to use, unreliable, or hard to maintain, it can negatively impact the entire system.

For example, imagine you’re using a piece of software that is difficult to use and prone to crashing. Even if the software technically meets all its functional requirements, it will still be frustrating and time-consuming to use. In addition, it can have a ripple effect throughout the entire system, slowing down other processes and potentially causing errors or delays.

By focusing on software quality and not just functional correctness, you can ensure that your software is reliable, easy to use, leading to a better overall user experience and more successful outcomes.

Summing up

While functional correctness is an essential aspect of software development, it’s not the only one. To truly ensure that your software meets the needs of your users, you need to focus on software quality and testing. By taking a holistic approach to software development, you can help ensure that your software is reliable, easy to use, and easy to maintain, leading to better outcomes for everyone involved.

My Personal Kanban 2.0 Beta, Open Sourced

The year 2020 brought the opportunity to spend time learning new skills. I picked the old pet project, My Personal Kanban and decided to rewrite it with a completely different technology set. 

Here it is, version 2.0 of My Personal Kanban. This time, it’s a standalone app, running on MacOS, Linux and Windows

I’m using the app instead of a real-life Kanban board for my Personal Kanban. If you are not familiar with Personal Kanbans and why they are suitable for Personal Productivity, I recommend this short article with a video explaining why Personal Kanban is excellent. 

A bit more about technologies

My Personal Kanban 1.x was a single page web app using local browser storage and suffered from never-ending cross-browser compatibility issues. I also delivered it using Angular 1.x of which I was not a big fan. 

As I saw beautiful applications written with Electron framework, including Visual Studio Code or Slack Desktop client, I thought of learning Electron myself. 

In the end, I landed the following stack:

  • Electron – it’s a framework for building cross-platform desktop apps with web technologies. It helped me to focus on building functionality, without worrying about cross-browser compatibility. It also made it easy to write the content of boards to the file system.
  • TypeScript – it’s a programming language, that brings type system to the power of JavaScript. I spend a lot of time at my job Java or Kotlin, and I like having type system to hand. Also, it was an excellent excuse to learn another language. 
  • ReactJS – it’s a JavaScript library for building User Interfaces. It was not my first contact with React, and I liked it from previous projects. However, this time I used it using functional style. 
  • Material-UI – it’s a library of React Components. I used the included Material Design style.
  • electron-react-boilerplate – it’s a boilerplate code, including all of the above frameworks (except Material-UI). It gave me a great starting point. 

I open-sourced the entire code at GitHub. And you can fetch the latest binaries from the My Personal Kanban 2.0 page.

Please get in touch via GitHub or the comments section if you have ideas about features or improvements to the application. 

Screenshot of My Personal Kanban on Mac

2.0.0-alpha-1 released, a new version of My Personal Kanban

Second release includes few new features that I was missing when using My Personal Kanban. Some of the features come from suggestions posted by users of the original My Personal Kanban, version 1.0.

My Personal Kanban version 2.0.0-alpha-1

The few main features include:

  • Limiting WIP
  • Cards tagging
  • Unique numbers on tags
  • Cosmetic changes and additional keyboard shortcuts

I still have some functionality I would like to deliver in the next few releases, including:

  • More keyboard shortcuts
  • Exporting/Importing of single board
  • Filtering of cards on the board by using tags

As before, I would love if you could give me some feedback on the Application.

The detailed description with OS specific downloadable binaries on the My Personal Kanban 2.0 page.

My Personal Kanban 2.0 – new version released

Seven years ago, I released an application that became quite popular with many practitioners of Personal Kanban. I decided it was time to give the app a refresh. 

As I was not too fond of the technologies I previously used to create My Personal Kanban 1.0, I decided to re-write the app from scratch using new technologies and creating My Personal Kanban 2.0 as a standalone application.

I picked Electron to achieve portability between multiple platforms and React for the UI framework. 

Today, I give you a first version of the My Personal Kanban 2.0, alpha 0. You can download OS-specific binaries from Box. List of binaries at the following page

In this release, I implemented the following features:

  • Creation of Boards as well as the removal of boards
  • Naming of columns
  • Creating, editing, viewing and deleting of the Kanban cards
  • Drag and drop of the cards between columns
  • Boards switching with board buttons
  • Archiving of cards in the last column
  • Browsing of card archives with a simple search
  • Dark and Light theme switching
  • Keyboard shortcut “Shif+A” for adding a new card
  • Choice switch, for adding new Kanban card at the beginning or end of the card list in a column
  • Saving of the content on the disk

Please, provide me with feedback and potential features you would like to see in the next upcoming releases.

Naming things is hard … and very important

Have you ever watched “The Croods“? When my daughter was younger, I watched it many times. The Croods are family of a caveman trying to survive another day in the dangerous, prehistoric world. There is no doubt in the entertaining value of the movie, but the thing that I remembered the most are the scenes where cavemen are attempting to name new “things”. I always wondered how did they come up with names for things, how come “wheel” is a wheel? It is difficult even to imagine the thought process. Why not try yourself? Think of a different name for a “wall”. 

800px-English-English_and_English-Persian_dictionaries

Naming things is hard. It’s even harder when you have to do it regularly during the day. If you are somehow puzzled to what profession requires to continually come up with proper names for things throughout the day, let me put you out of your misery; it is Software Developer or Software Engineer. 

When creating software, developers have to name: variables, functions, objects, modules, systems, classes, etc. All of them would have behaviour, which requires a proper name as well. Proper naming is crucial because:

  • it communicates meaning
  • it helps collaborate
  • reduces time and cost of maintenance

Working with a team means that developers have to collaborate and incorporate each-others code in their work. They need to understand the meaning of the code, intention and behaviour to incorporate it within their work correctly. 

Naming things in Software

Today, computer programs can contain thousands if not millions of lines of code. Without code being transparent, it is hard to modify it, change it, improve it. The naming of different elements of code is a massive part of making code clean. 

Each programming language has its own set of conventions and practices when it comes to naming. Following those standards provides a mental shortcut and reduces cognitive load during the development process. 

Naming standards are also crucial for aspects of the development process itself. Thanks to the common understanding of words and phrases like “build” and “release”, or “story” and “feature”, we know how to work with each other.

Naming things in the Development Flow

When working with code, we collaborate using Version Control Systems. The one that is the most popular at the moment is Git. Few services are offering Git repository hosting, with GitHub being defacto golden standard in the industry. 

branches

Git is quite flexible with the ways of using it; however, teams typically adopt one of the standard models. GitHub or Atlassian has a great set of posts explaining the different models. The model that seems the most suitable for the Enterprises that worked 90% of the time for the teams in companies I worked for seems to be GitFlow. The flow prescribes names for branches. Those names are relevant as of the points mentioned above in my post. Branch names help with the understanding of:

  • where to put code that is Work in Progress
  • where to integrated completed code
  • where to stage code ready for creating a release candidate
  • where to put code that is officially released and in production
  • where to put code that fixes issues and bugs

I do like to make it easy for people to do the right thing and hard or impossible to do the wrong thing. Hence I created a little GitHub Application, that looks after names of branches in the repository and raises an issue if the name is wrong or deletes the offending branch. 

You can check it out at https://greggigon.com/brunchyyy and https://github.com/greggigon/brunchyyy.

Final words

Correct naming is essential in software development. Naming standards provide mental shortcuts, reducing cognitive load. They also provide a shared vocabulary for communicating and building blocks of understanding. Pay attention to naming and help your teams adopting standards. 

I’m going to leave you with this funny short Clip from “The Croods” illustrating how hard it could be to name things correctly 🙂

Controlling central heating with Arduino and Raspberry Pi


When Arduino and Raspberry Pi released first versions, I did buy one of each. Being a gadget man and … well, a man, I played for a bit with my new toys and left them in a drawer.

Time has passed and not much happened with any of them. As I became increasingly unhappy with the central heating controller in my current house, I decided to take the Ino and Pi out of the drawer and actually build central heating controller that I would be happy with.

The design phase

First requirement of the new heating control system was the least intrusive installation as possible.

The dial thermostat that I have at home, works as a simple switch: switching the heating on when temperature falls bellow pre-set; and switching heating off when temperature rise above another pre-set. I decided to use this simplicity in my design. All I needed to do is hook with one 230V cable into that thermostat (230V, hell yeah).

With entry point sorted, I went into the controller bit. Arduino board will control the Relay, which will simply switch heating on/off. For the temperature reading I chose the Digital Thermometer which offered more stable reading than the Analog one (included in Arduino Uno starter kit). I’ve also added LED to indicate when the heating was on.

Leveraging serial port used to program Arduino, I decided that the board will send temperature updates and receive setup command from Pi via USB connection. It will also be powered via the same. This also solved a problem of 2 separate power adapters for both Arduino and Raspberry Pi.

The build phase

I’ve been trying few things before arriving with the below solution.

Electronics

The Arduino circuit is very simple.

circuit-smaller

Three elements connected to Arduino with a couple of resistors, not much.

The LED is not necessary, it’s there to indicate when the heating is switched on.

The final prototype doesn’t look very attractive, but the lot is hidden under the furniture and the only elements sticking out are the temperature sensors and a bit of LED.

Final prototype of my controller

 

 

Software

I had to write three separate pieces of software:

Arduino

For the temperature sensor I included two extra libraries, the OneWire protocol library and a DallasTemperature sensor library. I use 0.5 centi-degree approximation of a temperature reading.

Temperature reads are sent via Serial Port on every loop. Arduino also expects the Float number on a Serial Port. The received number indicates the desired room temperature for Arduino.

To limit the sensor reading fluctuations, the control of relay changes after at least 10 successful consecutive reads of the same temperature from the sensor.

Raspberry Pi

The software that runs on Raspberry Pi does the following:

  • It waits on the temperature updates from Arduino, and stores the Updates in Memory (for the latest update) and in simple file based H2 database (for historical data),
  • It exposes REST API for UI to get the temperature information and receive the new settings,
  • It schedules temperature changes according to schedule stored in the JSON file.

I started the code in Python, but it was running slow. I did a simple comparison of execution time for Prime number algorithms, and Java 8 was beating Python. On a single core Raspberry Pi 1, it was a good incentive to change the platform. I chose Kotlin programming language as it was new to me and I wanted to learn it.

As a framework for Event driven application I choose Vert.x 3. For Serial Port communication, a bit dated RXTX library.

The UI / Phone controller app

The Web App I build works on computers as well as mobile devices. I did choose React as a UI framework with Material UI components. The lot is build with Webpack into a small set of html/js files.

The testing phase

The testing phase involved connecting everything together, starting it, and hoping that I will not sense the smell of burning electrics and experience no explosions. In other words, a standard scientific and engineering approach 🙂 .

I do run the setup for 4 weeks continuously and it not failed so far.

Summary

This is the first time I used my skills to build something that interacts with physical world. It gave me a great feeling of achievement and satisfaction. I know that I could buy something that looks much nicer and probably works better but I learned a lot during the process.

Raspberry Pi 3 was released while I was building my design and I switched to it. You can see it in the pictures. I also want to switch Arduino Uno prototyping board to Arduino Nano.

All the code and more detailed technical description is available for you to grab from my GitHub repository on https://github.com/greggigon/Home-Temperature-Controller .

My approach to JSONP limitations

Why JSONP?

Kanban columnDuring the development of My Personal Kanban I stumbled across interesting problem. One of My Personal Kanban features that I was developing, was the possibility to upload Kanban to Google Cloud (Google App Engine application).

My Personal Kanban is designed to work off the local file system, without the need of Internet connection. It means that trying to send something into Interweb is going to hit modern Browser security settings.

The browser security feature prevents web request from being made to a site with a different domain. It also stops from making a request to anything other the same file if you have opened any web application from the local file system. This kind of behaviour is default across any modern web browser.

Fortunately, there is a special type of requests browser will allow happening and it’s JSONP. It’s a GET request with a callback parameter. Callback is a name of the function that the browser will call when it receives successful response from the web.

HTTP GET request limits

My Personal Kanban is written in JavaScript with Angular; server side on Google App Engine is a very simple Servlet written in Groovy.

When I finished my first implementation and started to test it locally with Google App Engine SDK it all looked good. However, upload stopped working when I tested with a real GAE deployment.

Quick research confirmed that different web server implementation might have different settings for Maximum Length of HTTP GET parameters. Those GET parameters are used to send JSONP request data to the web server. Google App Engine has different limit than GAE SDK (which uses Jetty).

I also discovered that the upload was working in one browser but stopped working in another. As it turns out, browsers have its own limits of length of HTTP GET request. It is literally the length of the URL you will put in your browsers address box.

My Personal Kanban is sending a bit of data. It’s not Megabytes, however still too much for the HTTP GET parameters.

Choices of workaround

I thought of writing My Personal Kanban as Chrome extensions. It would enable me to overcome the JSONP limitations however it would bind my application to work on Chrome only. So I ditched the idea.

I decided to chop data into small chunks and send it to the server. To minimize errors of the transfer I invented this Client-to-Server protocol:

  1. All calls during transmission to server are in order, so the data can be assembled in correct way.
  2. First a handshake is made announcing the beginning of transmission for specific user, with information of how many data chunks will be sent.
  3. Chunks of data are sent only if previous chunk was sent successfully.
  4. Finally MD5 hash of data is sent so the server can verify that what was received is correct.

On server side I decided to store chunks for a user in session which in case of Google App Engine is stored in Memcache backed by Data Store. What happens on the server:

  1. Server receives a handshake and creates new Array for data chunks (or removes previous one if transfer was not completed or not successful).
  2.  Server receives data chunks and places them in the Chunk Array stored in session.
  3. When server receives Kanban hash it concatenates the Array in order into String and validates against received hash. If the hash is valid it stores the Kanban in the Data Store.

Details and code samples

The uploaded Kanban is Encrypted with user key and kept on the Cloud encrypted to ensure data privacy. I’ve chosen Rabbit as encryption algorithm. As a side effect to encryption, transmitted data doesn’t need to be encoded and sanitized.
For encryption I’m using fantastic CryptoJS library. CryptoJS also includes MD5 hash implementation.


md5Hash : function(stringToHash){
	return CryptoJS.MD5(stringToHash).toString();
},

encrypt: function(stringToEncrypt, encryptionKey){
	var utfEncoded = CryptoJS.enc.Utf8.parse(stringToEncrypt);
	return CryptoJS.Rabbit.encrypt(utfEncoded, encryptionKey).toString();
},

decrypt: function(stringToDecrypt, encryptionKey){
	var notYetUtf8 = CryptoJS.Rabbit.decrypt(stringToDecrypt, encryptionKey);
	return CryptoJS.enc.Utf8.stringify(notYetUtf8);
}

Thanks to fantastic Angular Promise API it is very easy to implement ordered transmission of data.

var encryptetKanban = cryptoService.encrypt(kanban, this.settings.encryptionKey);
var kanbanInChunks = splitSlice(encryptetKanban, 1000);

var promise = sendStart(kanbanInChunks.length);
angular.forEach(kanbanInChunks, function(value, index){
	promise = promise.then(function(){
		return sendChunk(value, index + 1);
	});
});

return promise.then(function(){
	return checkKanbanValidity(encryptetKanban);
});

My Personal Kanban is Open Source project and available for browsing at https://github.com/greggigon/my-personal-kanban/

Conclusion

The above approach made it possible to upload data to the server from any browser eliminating issues related to default browser’s security settings.
Unfortunately it comes with a cost of more HTTP requests and custom server side coding.

For small amount of text data it is good enough for me, perhaps it would be good enough for you. Let me know your thoughts.