-
Testing the Agilogy Way
February 2, 2024
At Agilogy we have a curated way of testing software. Here I discuss some of my thoughts on the subject and I share the slides of an internal workshop that discuss the Principles, Patterns and Strategies to test software in Hexagonal Architectures.
-
Writing a Property Based Testing library in Kotlin, a Journey. Part 4: Housekeeping
January 12, 2024
In this entry we retake the Property Based Testing series. But instead of talking about PBT I'll be blogging about the process of enhancing the current design of the library and upgrading its Gradle and Kotlin versions.
-
Writing a simple JDBC library in Java
March 17, 2023
Let's pick Java this time. And let's implement a very simple wrapper library on top of Jdbc. Just for the fun of discussin the design. And as a way for me to catch up with "recent" Java versions. And by "recent" I mean those released in the past 5 years.
-
Writing a Parser Combinator Library in Scala 3.
Part 2: Choices and repetitions
December 16, 2022
We continue to build a Scala 3 parser combinator library by developing a Json parser using TDD. After some initial steps in part 1, we now want to parse arrrays and objects. For that, we'll need to handle choices (when we want to parse either one thing or another one) and sequences (when we want to parse one thing and then another one).
-
Writing a Parser Combinator Library in Scala 3.
Part 1: Introduction to Parsing
November 11, 2022
In this article we start writing a Parser Combinator Library in Scala 3 from scratch. But instead of using an algebraic design approach, like the Red book does, we will use a Json parser as an example of such parser and we will apply TDD while designing such parser.
-
Writing a Property Based Testing library in Kotlin, a Journey (part 3)
October 25, 2022
Our small property based testing library is working now. But whenever something goes wrong, we want the maximum usability, so that diagnosing (and therefore fixing) bugs is as easy as possible. One way we can make our lives easier is by providing a mechanism to re-run the test directly using the exact same example that was used in a previously failed test.
-
Writing a Property Based Testing library in Kotlin, a Journey (part 2)
October 14, 2022
We continue our journey into writing a property based testing library from scratch. This time we focus on generating combinators for arbitrary generators, so that our user can build new arbitrary generators from the ones provided by the library. We implement orNull, map and product2, product3, etc.
-
Writing a Property Based Testing library in Kotlin, a Journey (part 1)
October 4, 2022
Let's write a Property Based Testing library in Kotlin and see what happens!
-
Property based testing: Shrinking (part 2) - Shrinking functions
September 13, 2022
We can model property based testing shrinking as a shrink function that takes a value and produces a list of one step simpler values. Our testing libraries can provide those for simple, commonly used types, like Int, but we would need to provide user defined functions for our data types. But there are some difficulties in doing so.
-
Property based testing: Shrinking (part 1)
August 26, 2022
When a property test fails it provides an example for which our program doesn't behave. That randomly generated example may be too complex to diagnose the problem. Shrinking allows us to build simpler examples that still fail our tests, allowing for simpler reaasoning and debugging.
-
Testing other side effects
July 8, 2022
Trying to test a simple function with side effects takes us to talk about simplicity and, from there, we take the path of design to try to design a simpler solution. That brings us dependency injection. All because we wanted testability.
-
Testing and persistent state
June 17, 2022
Testing with persistent has certain implications. We propose to explicitly set the initial state and to check all of the final state after the test. We also propose to not share your persistent state (by using a not shared database). Finally, we give some thoughts to running multiple tests in parallel when persistent state is involved.
-
What is an automated test, again?
May 27, 2022
The basic automated testing recipe seems well-known and simple, but it is not sufficient when the system under test is not a pure function. Testing non-total functions is quite well understood. Testing systems with state is a bit more complicated and important details are often overlooked. At Agilogy, our approach to test such systems with state is to explicitly set the initial state of the system before exercising whatever functionality we want to test, and to also get and make assertions about the final state in addition to the usual assertions about any response or returned value. We show this…