Series

Code Smells

In this series, we will see several symptoms and situations that make us doubt the quality of our developments. We will present possible solutions. Most are just clues. They are no hard rules.

Articles in this series

Code Smell 108 - Float Assertions

Dec 3, 20211 min read 61 views

TL;DR: Don't compare floats Problems Wrong test results Fragile tests Fail fast principle violation Solutions Avoid floats unless you have REAL performance concerns Use arbitrary precision numbers If you need to compare floats compare with t...

Code Smell 108 - Float Assertions
Code Smell 107 - Variables Reuse
Code Smell 106 - Production Dependent Code
Code Smell 105 - Comedian Methods
Code Smell 104 - Assert True
Code Smell 103 - Double Encapsulation