Monday, 23 January 2017

An Introduction to Unit Testing (for WordPress)

Thorsten is a web developer since 2000, working with (and on) WordPress since 2005. Currently, Thorsten is a WordPress engineer and technical project lead at Inpsyde, Germany’s biggest WordPress agency. He is part of Inpsyde’s QA team, and leads the development of MultilingualPress, the multisite-based free open source plugin for your multilingual websites. He also maintains WP REST Starter, a Composer package for working with the WordPress REST API in an object-oriented fashion.
Thorsten is a certified PHP engineer, web development professional and tester.
If you are a software developer, you might have come across the term “testable code”. But what is it? What makes code testable, and what not?
Testable Code
Every piece of software is testable—somehow. There are several things you might be able to test:
the return value of a function;
the output of a function;
other side effects of executing a function;
whether or not a program crashes;

So, doesn’t that mean every piece of code is testable code?
It does not. That’s because almost always when someone refers to “testable code” they do it in the context of unit testing. So


No comments:

Post a Comment