Software testing is actually something that we have always done since we learned how to program, we have used it homework and projects from program classes, for example, in fundamentals of programing and POO. The purpose of testing is to verify that your program o software is doing or it does exactly what is intended to do and also to look for bugs that happens on particular cases.
Testing can be classified in two types, static and dynamic. Static is the examination of the program’s code, is somewhat implicit because text editors automatically check the source code and the syntax, so the program is not needed to me running for this kind of testing. On the contrary, dynamic testing involves the examination of the software when is running, and is used to verify that works according to the functional requirements.
What is more interesting are the different type of testing that can be used in software; there many of them so I will only write about some of them.
A common testing method is the box approach, which are the white box testing and the black box testing. The black box testing where testers are not required to know about the code, they only focuses on analyzing the relation between inputs and outputs on a running software. In white box testing, testers are required to have knowledge about the code and the internal working of the system and they focus on testing individual methods, statements, functions, etc.
For more information about more types of testing, you can check this page.
There exists tools that helps you with testing, specially when you are using an IDE because all of them have the tool named debug, which run your software step by step and it can also give you the variables that are being used an their current value, so that way you can analyze and see exactly what your software is doing.
There also frameworks that “automatically” test your code in such a way that you only have to wait for results. For example there is one for the java programming language named JUnit ans is included in most of the IDE like NetBeans or Eclipse. For more information check this post about JUnit.
You can check this course from Udacity to know more about software testing: