Book Image

Building a Web Application with PHP and MariaDB: A Reference Guide

By : Sai S Sriparasa
Book Image

Building a Web Application with PHP and MariaDB: A Reference Guide

By: Sai S Sriparasa

Overview of this book

Table of Contents (17 chapters)
Building a Web Application with PHP and MariaDB: A Reference Guide
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Unit testing


Now that we understand exception handling, this is a good place to take a look at the concept of unit testing. As the name suggests, unit testing refers to testing the application one unit at a time. A unit is an arbitrary term but it is always advised to divide the code into the smallest independent working fragment and test that unit. In this section, we will briefly go over automated unit tests. Automated unit testing makes the process of testing the functionality easier as the application grows. Let us take the example of a student portal. We begin by building a simple portal that will allow us to add a student. Once we provide the portal to add students, the users of the portal would need an interface to view the student information that they have added. Once we provide this interface, they might request the development team for a lot more features. As we keep adding features, the amount of functionality that has to be tested will increase, and sometimes the code that has...