Articles tagged “unit-testing”
6 articles
- Review and refactor SoftwareEngineering.SE is a good place for interesting questions. One of the recent questions about unit tests was particularly interesting: not for its unit testing part, but for giving a small piece of code which may seem particularly…
- Unit tests, stubs and non-deterministic behavior When it comes to unit testing, beginner programmers are often blocked when reaching code which feels non-deterministic or when the result changes over time. Two classical examples are code which…
- The greatness of TDD illustrated During an interview, I was asked to solve the following problem: A validation function takes as input a string containing parenthesis and square brackets. It should return true if the closing parenthesis and brackets are matching the opening ones, or…
- Unit testing methods which are calling static methods Disclaimer: the article below talks about methods calling public static methods from other classes. This excludes the calls to private static methods. Recently, I wrote a rather unpopular answer on Stack Exchange about static methods in a context of…
- Tricky, tricky dates Any programmer who worked with dates would tell that dates are a complex subject. Time zones, UTC, daylight saving time, leap years, and, my favorite of all—leap seconds that “are not entirely…
- What targetting 100% code coverage taught me I was recently in charge of drafting a new system for a customer. I took it as an opportunity to demonstrate some of the approaches that should lead to higher quality software, compared to what the…