Good ideas come in two flavours: original and improvement. Original ideas are those that bring to the world something that was never conceived before: they are rare and difficult to come up with, but almost always have a lasting impact. Improvements take an idea from another field, and apply it to a novel one: they often imply seeing a pattern that is not formulated yet, and generalizing it.
I recently wrote about how many unit-tests one needs to write to reduce the number of faults in programs. One of the conclusion one can have is that this is a big number of tests to write! Surely, nobody have time to write that many tests by hand! That’s where property testing enters the scene. 1. A simple function: toUpper Imagine you have to write a new function named toUpper that takes a string as input, and returns the same string, but in upper case.
Writing unit-tests is an integral part of writing software. How many tests are needed? What coverage target should one aim for? What’s coverage anyway? Follow along on this quick journey, where I wonder those very questions. 1. Why do we need any tests? First and foremost, why would you need any tests, if you could simply prove that the program is right? After all, in mathematics, if we assume that there are an infinite number of prime numbers for example, we can just prove it, and we don’t have to test all numbers to check that this statement is true.
I am going to have a look at the Expression Problem starting from a simple floral code. Once the problem is faced, I’ll state it formally, and then I’ll have a look at the functional side of things. I’ll finish with solutions that appear in the literature, and see if any is easy to implement in Java. 1. OOP Flowers I enjoy flowers, and I want to break from the usual examples given in code (Java here).
Humble Pi, A Comedy of Maths Errors is a book by Matt Parker, released in 2019. The book is a fun read of maths mistakes that have consequences in the real world. This is not a book about formulas, nor is it about theorems, proofs, or how not to make mistakes in maths. The author states in the introduction that one of the purposes of the book is to show that maths is not always about being right, but more about the process of exploring the mathematical world.