Testing is the process of evaluating or exercising a system or system component by manual or automated means to verify that the software meets specified requirements. It is important because it measures the level of quality achieved and yet to be achieved. Testing helps avoid cascading of defects from one phase of software development to another. Cost of fixing defects after delivering it is more than cost of investing in testing.
Why do we test software?
Developers are unable build defect-free software. If the development processes were so good, meaning no defects were produced, so, obviously testing would not be necessary.