I want to know how exactly, we can ensure that a project is 100% tested ?
In banking or financial applications not 1% also tolerable.
So being a developer, how can you say your code is 100% tested?
Explanation with example is highly appreciated.
- Anybody can ask a question
- Anybody can answer
- The best answers are voted up and rise to the top
Short answer--you can't. As soon as you expose an application over a network, you've introduced an infinite number of possible variations and conditions that you cannot possibly predict to 100% certainty. What happens when a user does something incredibly stupid or unpredictable? What happens when a malicious user works out your processes and comes up with a hack? What happens when networks or hardware fails? You're never going to get all of it.
That said, you need to play to probabilities. Your user base, customers, and business owners should be able to identify how they expect the application to be used. That is, your requirements. Make sure each requirement has both positive and negative test cases based on a reasonable sample of test data and actions. After that, it's really a case of coming up with ways that the application might be misused and developing test cases around them. It is always possible to come up with another test, and thus my earlier statement that 100% is unattainable.
You CAN measure code coverage up to 100% (with the value of the last few percentage points being debatable). This will make sure that if any of your code is reached and run, it will behave in an expected manner. Code coverage makes no guarantees concerning the correctness of your application, just that you know that all of it will always work sometimes.
The problem with coding in finance is, at least in the market driven environments such as trading desks, that the codebase is built by non-professional programmers, mostly mathematicians or quants. These guys hack together matlab scripts and excel sheets in the worst possible way.
This issue has several sources:
Here is what I believe are good points to start with:
In this situation, your goal is not to be bug-free (if it ever is), it's to make as many people as possible understand what the code does. If they have a bit of an idea what's happening where, and where their numbers come from, they usually respect the code more and work more carefully. This leads to a lot less errors, and increases confidence in your results. Once you're there, you can start with the advenced software development techniques.
Obvious note: I'm talking about trading strategy related code here, not what's behind the accounting systems etc., because those back-end systems are usually built by professionals. Clearly, I'm not talking about professionals, and I ain't one either.