How Obeying to TDD Saved me Time

Obeying to the TDD (Test Driven Development) saved me a lot of time so I decided to write about it. It nicely shows the real-life advantage you can get from following TDD. Now, to keep it short - few days ago I was writing some business logic that did some audit recording changes. For the sake of brevity imagine it was something between those lines: public void recordAudits(Data data) { if (data....

January 8, 2017 · 2 min

Boolean methods and variables

When you have some non-trivial boolean statement used in if like: private void evict(Data data) { // ... if (data.getDate() >= MATURITY_DATE && data.type == DataType.UNDEF) { // do the eviction } } To make it easier to read and maintain, it’s a good idea to extract it to a local variable or method: private void evict(Data data) { // ... boolean isEligibleForEviction = data.getDate() >= MATURITY_DATE && data.type == DataType....

July 20, 2016 · 3 min