The best way to check if a variable consists any value or is empty is to use emptyÂ function from PHP itself.
$myVar = 0;
echo '$myVar is either 0, empty, or not set at all';
Though, while coding in PHP it shouldn’t be confused with isset which checks if a variable is set or not set, whether that variable is empty.
$myVar = 0;
echo '$myVar is set even though it is empty';
An interesting question and answers about DSL (Domain Specific Language) with Martin Fowler.
What is a Domain Specific Language?
A Domain Specific Language (DSL) is a computer programming language of limited expressiveness focused on a particular domain. Most languages you hear of are General Purpose Languages, which can handle most things you run into during a software project. Each DSL can only handle one specific aspect of a system.
Read complete question and answers here.
Our final term for this semester is going to start in the last week of August. I am also working on the final project for my course CS201. The project I am working on is a reservation system for a bus company. It is required to have:
- New Reservation
- Update Reservation
- Delete Reservation
- Search Reservation
The deadline for this project is 9th August. So I will be busy in this and will try to post the source code, once I get the marking on this project.
I am writing this project in C/C++ and usingÂ notepad++ for writing C/C++ code.
On a continuation to my previous post regarding Testing Automation Tools, I will try to write the process through which I went while writing the testing scripts.
The application for which I wanted to do the automated testing is a web based application written in PHP on top of Zend Framework. As Zend Framework follows the MVC pattern, we followed the same pattern. For database, we wrote our own layer and didn’t use the layer which Zend Framework provided.
For testing automation I followed the same design rules, which I followed while designing and writing this application. I wrote testing scripts for each entity in their own files. Then I called them in one main file, which I run when I want to run the regression test. Following is an example configuration file:
//include all files, which are required to run the test cases
// create company info
I treat this main script as my main configuration file. Where I declare some global variables, call those scripts which I need to run during my test run. I can include the scripts, which I need to run and can exclude those scripts which I don’t need.
I will continue with this series with further updates on how I wrote automated tests for every individual entity.
I recently started using Sahi. Sahi is an automation and testing tool for web applications, with the facility to record and playback scripts.
When I was trying to find any tool for testing automation, I evaluated many tools as the following:
- AutomatedQA’s TestComplete – It is one of the other product which I would love to use. It is an excellent product and could be used very nicely for GUI applications. I had to drop this from the list due to its price 🙁 and availability of free / open source automation tools for web.
- Watir – I couldn’t try this much but it was dropped from the list due to the learning curve involved in learning Ruby and then using this whole suite efficiently. Though, it seems to be a nice product and offers many add-ons.
In the next posts, I will try to post some more details about my testing experience.