Înapoi la articole →

Cel mai recent articol

Ultima verificare

Urmăritori 0 urmăritori
Articole: 113
  1. The Principle of Least Astonishment is the idea that software should behave in the way that least surprises the user.

  2. Consider this method which registers a visitor to an event. public class Event { public void registerVisitor(String name, String phoneNumber) { if (name == null || name.trim().isEmpty()) throw new IllegalArgumentException("Name w…

  3. Tests are often treated as write-once-never-look-at-again code (unless just maybe if there is a bug).

  4. How to write robust tests

    Many unit tests are brittle.

  5. I’ve talked about extracting logic and moving it elsewhere and I want to give an example of how doing so can improve the code.

  6. Don’t test private methods

    A common question when it comes to unit testing is: How do I test private methods?

  7. Find each bug once

    Despite our best efforts, every now and then a bug slips through.

  8. Most of us want to develop with quality.

  9. Unit testing friendly code is code that has enough complexity and few dependencies.

  10. Lots of developers feel that unit tests are not only hard to write, but also are more of a hinder than a help when working with the code.

  11. Common questions from people trying to introduce unit tests in a legacy code base are How do I unit test code which calls a static method?

  12. Tell me what to expect

    Working with a large code base, you get to see many different styles of unit testing.

  13. What, how, and why?

    When I develop code, I find it helps to use the following rule of thumb: What?