Where did that bug come from?

This is the second time this week that I encountered a annoying bug, introduced just by a small change in the code. Just when you think you can get away with minor changes without testing, you are in for a surprise.

The most common sense thing you can do is to test your code even for small changes; whether you are testing it yourself or sending it to the testing team. Seems simple, but how many times have you really done that. Its not that we are stupid, rather software was never so simple. Maybe we are careless sometimes. The moral is plain – treat even small changes important, and move it through a test before committing it to a version control.
(more…)

Read More

Test data generation for MySQL

One of the most time consuming steps in developing a database based application is test data generation. Imagine you have created a shopping cart application for your client, containing dozens of tables and hundreds of fields. Everything is ready for testing, but the problem is your database is empty. You at least require a modicum of test data in the database to proceed with the testing. You can choose to manually enter a small set of random data into the database, but you lose a couple of precious days in the process. What you require is a data generator that automatically generates test data for your database.
(more…)

Read More

Detecting duplicate code in PHP files

Duplicated code in projects is a frequent thing and also the one ripe for factoring out in a new class or function. Cut/Paste coding is a common development practice among programmers, a lot of which can lead to code size increase and maintenance nightmares. PHPCPD (php copy paste detector) is a PEAR tool that makes it easier to detect duplicate code in php projects. Below is a short tutorial on the PHPCPD package.
(more…)

Read More

Selenium IDE Tutorial – Part 1

Selenium IDE is an integrated development environment for performing Selenium tests.  Selenium tests can be written as HTML tables or coded in various languages like C#, PHP, Perl, Python and can be run directly in most modern browsers.The IDE can help you to record, edit and debug tests. Currently the IDE is only available for Firefox (as if we developers will use any other) as a addon.

Here is a possible scenario for using Selenium. Imagine you have created a HTML form with about twenty fields and you have to repeatedly test the form. Filling the form every time can quickly become tedious. With Selenium you can automate the whole process and run the test as required. In this part we will see how to create a simple test in Selenium. So let’s get started.
(more…)

Read More