Friday, coffee, reading, weekend:
Showing posts with label test-driven development. Show all posts
Showing posts with label test-driven development. Show all posts
Friday, March 21, 2025
Wednesday, December 28, 2022
Friday, June 10, 2022
Sunday, January 6, 2019
Test-Driven Development - you are doing it wrong!
Test-Driven Development is one of those techniques that somehow is not as widely used as it should be. I know a lot of developers who can agree on the benefits it brings. Yet the same developers, when asked about practicing TDD, answer: “it does not work for me”.
When I tried to understand the “why” behind this statement, they start to struggle to find an explanation. They say they only add simple features. They say their application is not that complex. They have no time. Many of them tried, but it was “too time-consuming”, it cost too much effort.
I pair with some of them. On a couple of occasions I had long conversations with them to understand how they were doing it? What went wrong? What’s the conclusion? In many cases, the problem lies in the basics - they simply tried to apply TDD to every newly created object.
When I tried to understand the “why” behind this statement, they start to struggle to find an explanation. They say they only add simple features. They say their application is not that complex. They have no time. Many of them tried, but it was “too time-consuming”, it cost too much effort.
I pair with some of them. On a couple of occasions I had long conversations with them to understand how they were doing it? What went wrong? What’s the conclusion? In many cases, the problem lies in the basics - they simply tried to apply TDD to every newly created object.
Monday, January 23, 2017
For the sake of laziness!
I like well written code. I like to reach out for perfection. I like to look for the most suitable design and solution. I’m doing it not because I treat software development as a kind of art and myself as an artist. I never looked at this in this way. I’m doing it, because I know it pays off. And one of my greatest motivators is my own laziness.
Tuesday, April 5, 2016
First for test, second for implementation!
Test-Driven Development is a great technique, isn’t it? Today I want to propose you an experiment that may help you convince all of those struggling developers that writing code in such manner really improves your code and development.
What is the experiment about? It’s about only one, tiny commit which will force you to practice this technique for some time. Talk with your team/teams and propose a new way of doing pull requests. The first commit for test, the second for implementation. Easy, isn’t it?
What is the experiment about? It’s about only one, tiny commit which will force you to practice this technique for some time. Talk with your team/teams and propose a new way of doing pull requests. The first commit for test, the second for implementation. Easy, isn’t it?
Wednesday, December 16, 2015
Growing Object-Oriented Software, Guided by Tests
It’s been awhile since my last post. Recently, there have been many conferences and meetups I had pleasure to spoke at. Making presentations, carrying out research, readings, conducting reviews, etc., everything takes time. I need to admit that I like each part of this process, because I always learn something new. Even if I’m reading the same materials, blogs, books, even if I’m thinking once again about the same topic, I always find some things I didn’t noticed before.
Wednesday, September 9, 2015
main method should not be your test strategy
Nowadays many developers know about advantages of tests. We know how they’re helping us when we need to change or refactor the code. We also know how helpful they can be when we want to describe or show how a particular functionality works.
We are encouraging to write tests. To cover your code. To decrease uncertainty.
Yet, I’m still seeing a lot of articles where someone shares his knowledge about particular features and… he shows how the code works using main() method:
I’ve got one simple question – why?
We are encouraging to write tests. To cover your code. To decrease uncertainty.
Yet, I’m still seeing a lot of articles where someone shares his knowledge about particular features and… he shows how the code works using main() method:
public class WhateverApp {
public static void main(String[] args) {
DescribedFunctionalityProvider provider = new DescribedFunctionalityProvider();
Result result = provider.showHowYouDoingThings();
System.out.println(result.showThatReallyWorks());
}
}
I’ve got one simple question – why?
Tuesday, March 3, 2015
What’s the deal with serialization?
Today we’re going to talk about a basic, (but from time to time useful) feature of Java — serialization.
Let’s start with theory. So what is serialization?
Let’s start with theory. So what is serialization?
To serialize an object means to convert its state to a byte stream so that the byte stream can be reverted back into a copy of the object
Sunday, May 11, 2014
Take a look at Local Classes
what will it be about?
Recently I tried to explain what nested classes are and what you can do with them. There were a few words about Static Nested Classes and Inner Classes. I've also mentioned that there are two more types, which are special kind of Inner Class. And today I want to write something about one of it - Local Classes.Ok, that's all great, but what Local Class is?
Local classes - classes that are defined in a block, which is a group of zero or more statements between balanced braces.
Which means that you can define a Local Classes inside any block.For example you can define a Local Class in a method body, a for loop, or an if clause.
Sunday, April 6, 2014
Take a look at Nested Classes
what will it be about?
After a few posts about Enums I want to present you another interesting feature of Java which is Nested Classes.In next a few articles I will try to introduce to you inner, static nested, local and anonymous classes. Of course, everything with usage of TDD :)
I will start with some basics - how to create a particular type of class, what is allowed and what's not. After introduction we will move forward and I will present some code which will show the ways of usage of those classes and, what's more important, the problems that result from their use.
I've gathered some material, I wrote a couple tests and it's turned around there is more text and code than I expected. That's why I decided to split it into a few shorter posts. Hopefully next ones will be published shortly, everything depends on how fast I will have a possibility to edit them.
Friday, March 7, 2014
This powerful Enum - part 2
let's move on
Recently I wrote about basics of Enums and when we finally knows them, we can take the next step and look how powerful Enums in Java really are.Today there will be more code, mostly covered with tests to prove that it works as I wrote :)
Monday, December 30, 2013
Happy New Year in TDD way :)
I will wish you only one thing - make those tests pass in one year from now :)
Friday, October 18, 2013
First steps with Hibernate - basic entity
learning through tests
Some time ago, when I started to learn Hibernate, I took a while and thought what would be the best way to learn this ORM. As a fan of test-driven development I decide to try learn it through tests and after a few tests were written I had to admit that choice was good and this is really efficient way of learning new things. Additionaly, I was practicing testing and improves my skills in this subject, which was also great benefit.Since then, whenever I have to or want to learn something new (language, library, ORM) I have the same approach and it works really well.
Recently I thought about this idea a few times and I decided to share my code with you. Maybe you will like this way of learning :)
Subscribe to:
Posts (Atom)