Thursday, April 3, 2014

Testing

There is a common misconception that testing should not be done by developers and it is somehow demeaning. Au contraire, it is equally (if not more) awesome as development. In testing you get to think of ways you can break your colleagues' software/website and are actually paid to try. And if you succeed, you're not reprimanded, but congratulated!
Testing done by a programmer has several advantages:

  • The tester will know how the developer thinks, so it will be easier for him to find discrepancies.
  • Being a developer himself, he will be able to suggest solutions that are actually feasible.
  • He can design test scripts for automated testing so he doesn't necessarily have to do it himself. Automated testing would also allow him to run thousands of test cases.
Let's go to the types of testing. It is classified mainly into the following types:
  1. White box (Glass box) testing and Black box testing
  2. Alpha testing and Beta testing
White box testing
It is also known as Glass box testing. This is done mainly by programmers in the early stages of development. This testing requires the tester to understand the internal working of the program: the control flow, backend, complexity etc. Hence it is called white/glass box testing, because the tester has to look into the metaphorical box.

Black box testing
This can be done by non programmers and is mostly done at the near-completion stages of development. As opposed to white box, the tester does not need to know the internal working. He just has to compare the desired output with the obtained output for a given range of input values.

Alpha testing
This testing is done by the developers all through development. This term is mostly heard in term of apps and software. Before the release, the developers test whether it is in fine working condition and does not unexpectedly crash or have bugs.

Beta testing
Everyone has heard this term. Developers release the beta version online so that people the world over can use it and report any bugs if they occur. They may point out some things that the developers might have missed. Also, even if there are no bugs, the developers may gain valuable inputs pertaining to how to make it more efficient, how to improve the user experience etc.

So, in conclusion, designing smart ways of testing a product is also a challenge. Plus, it's fun and you get paid for nullifying your colleagues' work.
Cheers!

Why does a second compilation always take lesser time?

This question comes to the mind of every programmer and is often asked in interviews. The answer is simple.
Consider a C program. You have several functions, classes, structures etc., or modules for short. During the first compilation, each module is parsed and tokenized. This takes a longer time. After this if changes are made in any module, it is recognized by the compiler. In the next compilation, only the ones that have been changed are parsed.
Hence subsequent compilations always take lesser time than the first due only to the reduced volume of code that needs to be compiled.
Cheers!

Wednesday, April 2, 2014

Open Source Database Engines - MySQL

Okay, now we come to our and the world's favorite DBE: MySQL. It is a massively powerful and Open Source DBE. It powers giants like Facebook (remember, in 'The Social Network', Jesse Eisenberg says 'I need a dedicated Linux box running Apache with a MySQL backend'?).

The source code is available under the GNU General Public Licence, as well as under several proprietary agreements. It is a popular choice to be used in LAMP based web design.

LAMP stands for Linux, Apache, MySQL, Perl/PHP/Python. Popular examples of applications that use MySQL databases are:

  • TYPO3
  • MODx
  • Joomla
  • Wordpress
  • phpBB
  • MyBB
  • Drupal

Websites that use MySQL include:
  • Google
  • Wikipedia
  • Flickr
  • Facebook
  • Twitter
  • Youtube

MySQL Workbench is a free integrated environment that allows users to graphically alter and work on their databases. As opposed to SQLite, it is native to a machine, and its data cannot be directly copied to another database. On the other hand, it allows customized queries which results in faster searches and more effective operation.
That's a bird's eye view of MySQL folks!
Cheers!

Tuesday, April 1, 2014

Open Source Database Engines - SQLite

Like Open Source software, Open Source database engines (DBE's) are taking the IT industry by storm, for two reasons: first, because they are free, of course, and second, because they are much more powerful as opposed to traditional, paid DBMS's. The three most famous Open Source DBE's are SQLite, MongoDB and of course, everyone's favorite, MySQL. Let's discuss each one in detail.

SQLite
Contrary to popular belief, it's not pronounced S-Q-L-Lite, but rather S-Q-Lite. It supports up to 2^64 rows (wow!). It is great mainly for three reasons:

  • Connecting to an SQLite database creates a .db file, which can easily be transported from one place to another using a flash drive or e-mail (it's size is freakishly small). So you can have multiple copies of the same database on multiple systems.
  • It is a great starting point for people new to databases and their connectivity to software, websites etc.
  • It provides an easy and lightweight testing mechanism. What I mean to say is that you can easily test your website/software's database connectivity and other operations with this engine and then move to bigger and better engines like MySQL.

However, it falls short in the following aspects:
  • It supports up to 2^64 rows for all tables in total. So, for a large website like Facebook, where there are millions of users, each with hundreds of photos, it will fall laughably short.
  • It is not as efficient as MySQL in terms of query resolution when there are a large number of tables and entries.
  • It does not support joins.

So, in conclusion, SQLite: great for beginners and testers, but not so for advanced programmers and projects.
Cheers!

What to learn before you start hacking

Because of movies, hackers are the most misunderstood people of all time. We often see them as bad people who gain unauthorized access into systems and do some damage. In reality, most of them are just enthusiasts who look for vulnerabilities in systems and try to learn from it. There's also ethical hacking, where hackers are paid to hack the system and report where the security is lacking.
There are two main types of hacking:
  1. Hardware 
  2. Software
Hardware hacking
In this type, you take apart an actual piece of hardware (e.g. a cell phone) and do something that will compromise its functioning in some way (e.g. installing a bug). We will not be discussing this type, mainly because I know very little about it.

Software hacking
In this type, you hack whatever is virtual (i.e. non tangible). This includes software, websites, computers, networks and many more. This is one we'll be talking about. You need to study a system carefully to evaluate the weak points and exploit them.

The following things are required to kick start your hacking endeavor:
  1. Learn programming. Not only logic, but also some languages.
  2. Learn C and C++. They are responsible for almost all the systems programming done today. In that, many find pointers tedious (I personally don't know why). Make it a point to learn it well. Pointers (if improperly used) are one of the many weak points C and C++ scripts have.
  3. In case of websites, learn server side scripting languages like Python and PHP.
  4. For exploiting networks, you need to learn how they function. Read about routers, bridges, gateways, subnets, masks, IP spoofing and much more.
  5. Learn SQL and databases. Most of the times the vulnerabilities you will be exploiting in software and websites are in the databases.
  6. Be creative. Technologies constantly evolve to keep miscreants from exploiting them.

Once you are done with all this, start designing your own software, website etc. Try to protect them from all the vulnerabilities you learnt from the aforementioned theory. Go to Github (github.com), get source codes of projects you find interesting and try looking for bugs in that code. If you do find one, report it and if possible, fix it.

Hacking is not done only by criminals, as shown in movies. It is a way of life. The curiosity, creativity and knowledge of computers helps you in the long term. In movies, hacking is shown to be incredibly glamorous. But in real life, protecting systems against hackers is equally glamorous and more challenging.

That's all for now!
Cheers!

Monday, March 31, 2014

Open Source Technologies

Introduction
Nowadays the words 'Open Source' have become exceedingly common and everyone hears them at least once a day. The reason this is happening because the open source idea has revolutionized the world of computers and human life in general. 'Open Source' is generally heard in the context of software and operating systems (Linux and Android are two major examples). Another term commonly heard is 'FOSS'. It stands for 'Free Open Source Software'. Now let me clear a misconception. Open Source tech does not imply it is free. Only FOSS tech is both open source and free, others may not be.

Why is open source better?
Open source means that the source code of that particular technology can be viewed by anybody in the world. Each tech has its own Internet forum where developers post suggestions and changes in the code. Every few months, the best ones are picked up and a new version of that tech is released. Neat, huh?
Now the reason this is better is that the code can be viewed by independent third parties, which means they may point out gaping holes the developers might have missed. This improves the user experience with a better interface and makes it extremely hard for miscreants to hack. So things like antivirus softwares (which are useful but far from bulletproof, don't even get me started on that) are rendered redundant. And developers who specialize in front end and back end can work on the respective components of that tech without disturbing the other. And in the end, the way everything seamlessly integrates to form a stunning piece of tech is just breathtaking.

Open source v/s Proprietary softwares
Proprietary software products are the ones you have to pay for, and pay repeatedly for license renewal, unless you are the type who would painstakingly obtain cracked versions. Open source softwares have no such thing as 'licensing period'. The latter often fall short for which the former makes up. Common examples are:
  • Gimp as a replacement for Adobe Photoshop
  • Mozilla Firefox instead of Internet Explorer
  • Office Suite instead of Microsoft Office

How do open source technologies make money?
This is a very good question. As I said earlier, not all pieces of Open Source software are free. But for those who are, there are several ways of making money.
  • The download can be free but they may charge a fee for the source code
  • They may sell the documentation
  • They may charge for support and installation qualification, like in the case of RedHat for Linux or Revolution for R.
  • They may provide maintenance services online, which is somewhat like SaaS (Software as a Service), but I digress.
  • If they get very famous, VCs (Venture Capitalists) may want to invest in them and set them up with a market share structure. They will then sell their shares.

It is not a surprise therefore that OpenSource is stealing a steady march over paid, licensed software.

So, in conclusion, open source tech is the future. I'm a huge fan of this idea, just in case you didn’t already guess from from how much I've been gushing about it throughout this article. I develop and contribute to this movement in my own little way, checking source codes of various software packages and trying to edit the code.

Come, consider joining the movement.
Cheers!