Quantcast
Channel: Frankreich – Seite 11 – mynethome.de
Viewing all articles
Browse latest Browse all 64

Unit-Test?

$
0
0

In regelmäßigen Abständen kommt immer wieder mal die Diskussion auf, wo man einen Unit-Test zu anderen Tests (Integrations- oder Aktzeptanz-) abgrenzen kann.
Eine meiner Meinung nach ganz brauchbare Definition hab ich kürzlich im Blog zum Buch „The Art of Unit Testing“ gefunden:

A good unit test is:

  • Able to be fully automated
  • Has full control over all the pieces running (Use mocks or stubs to achieve this isolation when needed)
  • Can be run in any order if part of many other tests
  • Runs in memory (no DB or File access, for example)
  • Consistently returns the same result (You always run the same test, so no random numbers, for example. save those for integration or range tests)
  • Runs fast
  • Tests a single logical concept in the system
  • Readable
  • Maintainable
  • Trustworthy (when you see its result, you don’t need to debug the code just to be sure)

(Vgl. Definition of a Unit test)

Mal hier abgelegt, damit ich sie zu gegebener zeit auch wiederfinde ;-)

Happy coding!


Viewing all articles
Browse latest Browse all 64

Latest Images





Latest Images