Regardless of skill level, a programmers goal is to write bug-less code on the first attempt. Is this possible… more than likely not. One may argue that more seasoned programmers should eventually master such a skill, but realistically, even the best programers will have 1 - 3 bugs per 100 lines of code. This statistic emphasis why testing is the most important part of coding.
Validation drives reliability, and the best way to achieve reliability is via testing. Unreliable code is useless and costly, so it is best to eradicate them. Although this is not completely possible we can take measures to drastically decrease the amount faults found in a program. We first start identifying the true purpose of testing. Testing is not a procedure to conclude that a program works, it can only concretely shows us that a program does not work. The laws of probability show us that as testing increases, the probability of finding faults increases. Hence, more testing decreases the chances of showing that a program works.Thus, the purpose of testing has to objectives:
1). to achieve an acceptable a level of reliability.
2). to show that a program has faults.
We then debunk the fallacy that testing and debugging are interchangeable roles. As mentioned previously, the purpose of testing is show reliability and that a program has faults. However, the purpose of debugging to correct bugs that caused a faults in the program.
Last, but not least, we organize how we build test cases and ensure that test cases are testing the specified requirements of the system. It is best to implement test cases in a layered form composed of Unit, Component and Integration test layers. Unit testing is the process of testing small chunks of code at a time. This allows for functional specifications to be tested. Component testing is the testing of one or more aggregated units with subroutines. This shows if the implemented structure does not match the intended design structure. Integration testing is the process of identifying if faults arise from aggregation of components into larger components. System testing is the process of identifying faults that arise from interactions between all the layers of the system. This also includes testing to ensure non-functional requirements are satisfied.
No comments:
Post a Comment