Loading...
 

Unit Testing

In computer programming, Unit Testing is a software testing method by which individual units of source code, sets of one or more computer program modules together with associated control data, usage procedures, and operating procedures are tested to determine if they are fit for use.1

Unit Tests are primarily written as a good practice to help developers identify and fix bugs, to refactor code and to serve as documentation for a unit of software under test. To achieve these benefits, unit tests ideally should cover all the possible paths in a program. One unit test usually covers one specific path in one function or method. However a test method is not necessary an encapsulated, independent entity. Often there are implicit dependencies between test methods, hidden in the implementation scenario of a test. --Adrian Kuhn et. al.2

Test Driven Development (TDD) is a software development process that relies on the repetition of a very short development cycle: first the developer writes a failing automated test case that defines a desired improvement or new function, then produces code to pass that test and finally refactors the new code to acceptable standards. Kent Beck, who is credited with having developed or 'rediscovered' the technique, stated in 2003 that TDD encourages simple designs and inspires confidence.3

PHP Unit Testing

PHPUnit

PHPUnit is a programmer-oriented testing framework for PHP. It is an instance of the xUnit architecture for unit testing frameworks.4

PHPUnit Basics Part1

PHPUnit Basics Part2

Python / Django Unit Testing

Harry Percival - TDD with Django, from scratch: a beginner's intro to testing and web development

O'Reilly Webcast: TDD Web Development from Scratch with Python

1 Unit testing. (2014, May 22). In Wikipedia, The Free Encyclopedia. Retrieved 00:49, June 13, 2014, from http://en.wikipedia.org/w/index.php?title=Unit_testing&oldid=609698259
3 Test-driven development. (2013, October 9). In Wikipedia, The Free Encyclopedia. Retrieved 03:04, October 13, 2013, from http://en.wikipedia.org/w/index.php?title=Test-driven_development&oldid=576503904

Last edited by MichaelAlber .
Page last modified on Wednesday June 26, 2019 19:34:48 UTC.

Books

Linux Command Line and Shell Scripting Bible Linux Command Line and Shell Scripting Bible - Linux Command Line and Shell Scripting Bible is your essential Linux guide. With detailed instruction and abundant examples, this book teaches you how to bypass the graphical interface and communicate directly with your computer, saving time and expanding capability.


Linux Bible Linux Bible - Linux continues to be an excellent, low-cost alternative to expensive operating systems. Whether you're new to Linux or need a reliable update and reference, this is an excellent resource. Veteran bestselling author Christopher Negus provides a complete tutorial packed with major updates, revisions, and hands-on exercises so that you can confidently start using Linux today.


Learning Python Learning Python - Portable, powerful, and a breeze to use, Python is the popular open source object-oriented programming language used for both standalone programs and scripting applications.


Modern PHP: New Features and Good Practices Modern PHP: New Features and Good Practices - PHP is experiencing a renaissance, though it may be difficult to tell with all of the outdated PHP tutorials online. With this practical guide, you'll learn how PHP has become a full-featured, mature language with object-orientation, namespaces, and a growing collection of reusable component libraries.